summaryrefslogtreecommitdiffstats
path: root/audio/decode
diff options
context:
space:
mode:
authorMartin Herkt <lachs0r@srsfckn.biz>2016-10-19 19:09:00 +0200
committerMartin Herkt <lachs0r@srsfckn.biz>2016-10-19 19:09:00 +0200
commit5d74fa7dc0fa1617d1d11b69769423b1387ec785 (patch)
tree882752015b3500c91b8ab3a4d669696f23feb817 /audio/decode
parentc226bc7616ab2ae9de6172660e9cf727f07dc374 (diff)
parenta2fa0d0b68ce200598122145254f56ae1adff91e (diff)
downloadmpv-5d74fa7dc0fa1617d1d11b69769423b1387ec785.tar.bz2
mpv-5d74fa7dc0fa1617d1d11b69769423b1387ec785.tar.xz
Merge branch 'master' into release/current
Diffstat (limited to 'audio/decode')
-rw-r--r--audio/decode/ad_lavc.c8
-rw-r--r--audio/decode/dec_audio.c6
2 files changed, 11 insertions, 3 deletions
diff --git a/audio/decode/ad_lavc.c b/audio/decode/ad_lavc.c
index 78d0cec807..e28558414d 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 =
@@ -242,7 +245,8 @@ static int decode_packet(struct dec_audio *da, struct demux_packet *mpkt,
if (!got_frame)
return 0;
- double out_pts = mp_pts_from_av(priv->avframe->pkt_pts, &priv->codec_timebase);
+ double out_pts = mp_pts_from_av(MP_AVFRAME_DEC_PTS(priv->avframe),
+ &priv->codec_timebase);
struct mp_audio *mpframe = mp_audio_from_avframe(priv->avframe);
if (!mpframe)
diff --git a/audio/decode/dec_audio.c b/audio/decode/dec_audio.c
index d455770a74..3028d9988e 100644
--- a/audio/decode/dec_audio.c
+++ b/audio/decode/dec_audio.c
@@ -180,10 +180,14 @@ static void fix_audio_pts(struct dec_audio *da)
if (da->current_frame->pts != MP_NOPTS_VALUE) {
double newpts = da->current_frame->pts;
+
+ if (da->pts != MP_NOPTS_VALUE)
+ MP_STATS(da, "value %f audio-pts-err", da->pts - newpts);
+
// Keep the interpolated timestamp if it doesn't deviate more
// than 1 ms from the real one. (MKV rounded timestamps.)
if (da->pts == MP_NOPTS_VALUE || fabs(da->pts - newpts) > 0.001)
- da->pts = da->current_frame->pts;
+ da->pts = newpts;
}
if (da->pts == MP_NOPTS_VALUE && da->header->missing_timestamps)