History

flvdec: expose metadata through the generic metadata API original patch from Art Clarke aclarke _at_ xuggle _dot_ com

Originally committed as revision 19364 to svn://svn.ffmpeg.org/ffmpeg/trunk

Aurelien Jacobs committed 17 years ago

Commit df2bd711 parent 09e54e11 file · +7 −1Browse files

Unified · Split

libavformat/flvdec.c+7−1
@@ -24,6 +24,7 @@ · 23 unmodified lines
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 */25 */
26 26
27#include "libavutil/avstring.h"
27#include "libavcodec/bytestream.h"28#include "libavcodec/bytestream.h"
28#include "libavcodec/mpeg4audio.h"29#include "libavcodec/mpeg4audio.h"
29#include "avformat.h"30#include "avformat.h"
@@ -218,11 +219,16 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, AVStream *vst · 188 unmodified lines
218 vcodec = vstream ? vstream->codec : NULL;219 vcodec = vstream ? vstream->codec : NULL;
219 220
220 if(amf_type == AMF_DATA_TYPE_BOOL) {221 if(amf_type == AMF_DATA_TYPE_BOOL) {
222 av_strlcpy(str_val, num_val > 0 ? "true" : "false", sizeof(str_val));
223 av_metadata_set(&s->metadata, key, str_val);
221 } else if(amf_type == AMF_DATA_TYPE_NUMBER) {224 } else if(amf_type == AMF_DATA_TYPE_NUMBER) {
225 snprintf(str_val, sizeof(str_val), "%.f", num_val);
226 av_metadata_set(&s->metadata, key, str_val);
222 if(!strcmp(key, "duration")) s->duration = num_val * AV_TIME_BASE;227 if(!strcmp(key, "duration")) s->duration = num_val * AV_TIME_BASE;
223 else if(!strcmp(key, "videodatarate") && vcodec && 0 <= (int)(num_val * 1024.0))228 else if(!strcmp(key, "videodatarate") && vcodec && 0 <= (int)(num_val * 1024.0))
224 vcodec->bit_rate = num_val * 1024.0;229 vcodec->bit_rate = num_val * 1024.0;
225 }230 } else if (amf_type == AMF_DATA_TYPE_STRING)
231 av_metadata_set(&s->metadata, key, str_val);
226 }232 }
227 233
228 return 0;234 return 0;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t