aboutsummaryrefslogtreecommitdiffhomepage
path: root/audio
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2016-10-02 12:55:22 +0200
committerGravatar wm4 <wm4@nowhere>2016-10-02 12:55:22 +0200
commit6f4d918cb7a500ff354e13cf6f83c53799d3cc24 (patch)
treef6f5830086bc68aadb0365067bb75b2ca3e4a2e1 /audio
parent8d29d5b5d73801ec41c9d86d8079b0527818ea1d (diff)
audio: dump timestamp difference
Can help to analyze timestamp jitter or seeing completely bogus timestamps.
Diffstat (limited to 'audio')
-rw-r--r--audio/decode/dec_audio.c6
1 files changed, 5 insertions, 1 deletions
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)