Skip to content
Snippets Groups Projects
Commit 9a354fe3 authored by Stefan de Konink's avatar Stefan de Konink Committed by Benoit Fouet
Browse files

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
parent 822617cd
No related branches found
No related tags found
No related merge requests found
...@@ -187,6 +187,8 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, AVStream *vst ...@@ -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; 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, "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, "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) else if(!strcmp(key, "audiocodecid") && acodec && 0 <= (int)num_val)
flv_set_audio_codec(s, astream, (int)num_val << FLV_AUDIO_CODECID_OFFSET); flv_set_audio_codec(s, astream, (int)num_val << FLV_AUDIO_CODECID_OFFSET);
else if(!strcmp(key, "videocodecid") && vcodec && 0 <= (int)num_val) else if(!strcmp(key, "videocodecid") && vcodec && 0 <= (int)num_val)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment