diff options
author | wm4 <wm4@nowhere> | 2016-08-29 12:46:12 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-08-29 12:46:12 +0200 |
commit | 0110b738d5d37a0f7cafd522b89017436f7cfd73 (patch) | |
tree | fe5ee235a24d6e51804b3a959f535c0f19661513 /video/decode | |
parent | bda614bfd81ae4660ed6356bc124e015645ff3b0 (diff) |
vd_lavc, ad_lavc: set pkt_timebase, not time_base
These are different AVCodecContext fields. pkt_timebase is the correct
one for identifying the unit of packet/frame timestamps when decoding,
while time_base is for encoding. Some decoders also overwrite the
time_base field with some unrelated codec metadata.
pkt_timebase does not exist in Libav, so an #if is required.
Diffstat (limited to 'video/decode')
-rw-r--r-- | video/decode/vd_lavc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 8cc5d4eca4..18cbeda4e9 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -460,7 +460,10 @@ static void init_avctx(struct dec_video *vd, const char *decoder, avctx->opaque = vd; avctx->codec_type = AVMEDIA_TYPE_VIDEO; avctx->codec_id = lavc_codec->id; - avctx->time_base = ctx->codec_timebase; + +#if LIBAVCODEC_VERSION_MICRO >= 100 + avctx->pkt_timebase = ctx->codec_timebase; +#endif avctx->refcounted_frames = 1; ctx->pic = av_frame_alloc(); |