From 63373ca424f5eaef50a797b7bc7f6c395ed23331 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 22 Jul 2014 23:04:12 +0200 Subject: encode: deal with codec->time_base deprecation This seems to work with both Libav 10 and FFmpeg d3e51b41. --- common/encode_lavc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'common') 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; -- cgit v1.2.3