summaryrefslogtreecommitdiff
path: root/libavformat/flvenc.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2014-05-27 09:49:29 +0200
committerAnton Khirnov <anton@khirnov.net>2014-05-29 08:01:30 +0200
commit43e7f0797f9f821a3866a20f05e512e13c82076a (patch)
tree9e3c24ed32f7b903982291bd94d50506bbb474c7 /libavformat/flvenc.c
parentcf6977712c9e5abe6dc55289f6322ccbf10321a9 (diff)
downloadffmpeg-43e7f0797f9f821a3866a20f05e512e13c82076a.tar.gz
flvenc: only write the framerate tag based on avg_frame_rate
Do not fall back on the codec timebase, since that can be anything for VFR video.
Diffstat (limited to 'libavformat/flvenc.c')
-rw-r--r--libavformat/flvenc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index 3364f2ca3f..e87c256694 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -205,8 +205,6 @@ static int flv_write_header(AVFormatContext *s)
if (s->streams[i]->avg_frame_rate.den &&
s->streams[i]->avg_frame_rate.num) {
framerate = av_q2d(s->streams[i]->avg_frame_rate);
- } else {
- framerate = 1 / av_q2d(s->streams[i]->codec->time_base);
}
if (video_enc) {
av_log(s, AV_LOG_ERROR,
@@ -307,8 +305,10 @@ static int flv_write_header(AVFormatContext *s)
put_amf_string(pb, "videodatarate");
put_amf_double(pb, video_enc->bit_rate / 1024.0);
- put_amf_string(pb, "framerate");
- put_amf_double(pb, framerate);
+ if (framerate != 0.0) {
+ put_amf_string(pb, "framerate");
+ put_amf_double(pb, framerate);
+ }
put_amf_string(pb, "videocodecid");
put_amf_double(pb, video_enc->codec_tag);