diff options
author | Stefan de Konink <stefan@.konink.de> | 2009-02-02 16:05:50 +0000 |
---|---|---|
committer | Benoit Fouet <benoit.fouet@free.fr> | 2009-02-02 16:05:50 +0000 |
commit | 9a354fe3f98af0e33cb62014fef6d3e513a8f28e (patch) | |
tree | 5e3f4d8f223195904317b689b25945b415ad966e | |
parent | 822617cd509570ba54167dad1447a7c35856acf9 (diff) | |
download | ffmpeg-9a354fe3f98af0e33cb62014fef6d3e513a8f28e.tar.gz |
Implement the reading of the video bitrate of flv movies out of the meta data,
to have the total bitrate available in the avformat structures.
Patch by Stefan de Konink stefan konink de
Originally committed as revision 16943 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/flvdec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index ec9b471f48..c13a530a08 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -187,6 +187,8 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, AVStream *vst if(!strcmp(key, "duration")) s->duration = num_val * AV_TIME_BASE; // else if(!strcmp(key, "width") && vcodec && num_val > 0) vcodec->width = num_val; // else if(!strcmp(key, "height") && vcodec && num_val > 0) vcodec->height = num_val; + else if(!strcmp(key, "videodatarate") && vcodec && 0 <= (int)(num_val * 1024.0)) + vcodec->bit_rate = num_val * 1024.0; else if(!strcmp(key, "audiocodecid") && acodec && 0 <= (int)num_val) flv_set_audio_codec(s, astream, (int)num_val << FLV_AUDIO_CODECID_OFFSET); else if(!strcmp(key, "videocodecid") && vcodec && 0 <= (int)num_val) |