summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/encode_lavc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/common/encode_lavc.c b/common/encode_lavc.c
index df5710e07a..8877033f8d 100644
--- a/common/encode_lavc.c
+++ b/common/encode_lavc.c
@@ -590,11 +590,8 @@ AVStream *encode_lavc_alloc_stream(struct encode_lavc_context *ctx,
}
avcodec_get_context_defaults3(stream->codec, ctx->vc);
- // stream->time_base = ctx->timebase;
- // doing this breaks mpeg2ts in ffmpeg
- // which doesn't properly force the time base to be 90000
- // furthermore, ffmpeg.c doesn't do this either and works
-
+ // Using codec->time_base is deprecated, but needed for older lavf.
+ stream->time_base = ctx->timebase;
stream->codec->time_base = ctx->timebase;
ctx->voptions = NULL;
@@ -626,6 +623,8 @@ AVStream *encode_lavc_alloc_stream(struct encode_lavc_context *ctx,
}
avcodec_get_context_defaults3(stream->codec, ctx->ac);
+ // Using codec->time_base is deprecated, but needed for older lavf.
+ stream->time_base = ctx->timebase;
stream->codec->time_base = ctx->timebase;
ctx->aoptions = NULL;