summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Bradshaw <mjbshaw@google.com>2016-12-27 22:05:35 -0800
committerMichael Niedermayer <michael@niedermayer.cc>2017-01-14 20:03:56 +0100
commit3ac46a0a62386a52e38c066379ff36b5038dd4d0 (patch)
treee3341e96841a81e8ce6396ba11f563b2cf1f3c05 /ffmpeg.c
parent743052ec5bd6fef7b0f465dbd9ccc4e570ef8a02 (diff)
ffmpeg: Add -time_base option to hint the time base
Signed-off-by: Michael Bradshaw <mjbshaw@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index df0ad32b5c..6d1e358a85 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2905,7 +2905,8 @@ static int init_output_stream_streamcopy(OutputStream *ost)
return ret;
// copy timebase while removing common factors
- ost->st->time_base = av_add_q(av_stream_get_codec_timebase(ost->st), (AVRational){0, 1});
+ if (ost->st->time_base.num <= 0 || ost->st->time_base.den <= 0)
+ ost->st->time_base = av_add_q(av_stream_get_codec_timebase(ost->st), (AVRational){0, 1});
// copy disposition
ost->st->disposition = ist->st->disposition;
@@ -3330,7 +3331,8 @@ static int init_output_stream(OutputStream *ost, char *error, int error_len)
}
// copy timebase while removing common factors
- ost->st->time_base = av_add_q(ost->enc_ctx->time_base, (AVRational){0, 1});
+ if (ost->st->time_base.num <= 0 || ost->st->time_base.den <= 0)
+ ost->st->time_base = av_add_q(ost->enc_ctx->time_base, (AVRational){0, 1});
ost->st->codec->codec= ost->enc_ctx->codec;
} else if (ost->stream_copy) {
ret = init_output_stream_streamcopy(ost);