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 /audio/decode/ad_lavc.c | |
parent | bda614bfd81ae4660ed6356bc124e015645ff3b0 (diff) | |
download | mpv-0110b738d5d37a0f7cafd522b89017436f7cfd73.tar.bz2 mpv-0110b738d5d37a0f7cafd522b89017436f7cfd73.tar.xz |
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 'audio/decode/ad_lavc.c')
-rw-r--r-- | audio/decode/ad_lavc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/audio/decode/ad_lavc.c b/audio/decode/ad_lavc.c index 78d0cec807..e5c426e912 100644 --- a/audio/decode/ad_lavc.c +++ b/audio/decode/ad_lavc.c @@ -103,7 +103,10 @@ static int init(struct dec_audio *da, const char *decoder) lavc_context->refcounted_frames = 1; lavc_context->codec_type = AVMEDIA_TYPE_AUDIO; lavc_context->codec_id = lavc_codec->id; - lavc_context->time_base = ctx->codec_timebase; + +#if LIBAVCODEC_VERSION_MICRO >= 100 + lavc_context->pkt_timebase = ctx->codec_timebase; +#endif if (opts->downmix && mpopts->audio_output_channels.num_chmaps == 1) { lavc_context->request_channel_layout = |