encode: deal with codec->time_base deprecation

This seems to work with both Libav 10 and FFmpeg d3e51b41.
This commit is contained in:
wm4 2014-07-22 23:04:12 +02:00
parent 1041850523
commit 63373ca424
1 changed files with 4 additions and 5 deletions

View File

@ -590,11 +590,8 @@ AVStream *encode_lavc_alloc_stream(struct encode_lavc_context *ctx,
} }
avcodec_get_context_defaults3(stream->codec, ctx->vc); avcodec_get_context_defaults3(stream->codec, ctx->vc);
// stream->time_base = ctx->timebase; // Using codec->time_base is deprecated, but needed for older lavf.
// doing this breaks mpeg2ts in ffmpeg stream->time_base = ctx->timebase;
// which doesn't properly force the time base to be 90000
// furthermore, ffmpeg.c doesn't do this either and works
stream->codec->time_base = ctx->timebase; stream->codec->time_base = ctx->timebase;
ctx->voptions = NULL; 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); 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; stream->codec->time_base = ctx->timebase;
ctx->aoptions = NULL; ctx->aoptions = NULL;