From c5a48c63321de00bb8cb6b91a8d6ed22caa3b36f Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 29 Jan 2016 22:44:20 +0100 Subject: audio: move pts reset check Reduces the dependency of the filter/output code on the decoder. --- audio/decode/dec_audio.c | 12 +----------- audio/decode/dec_audio.h | 3 --- 2 files changed, 1 insertion(+), 14 deletions(-) (limited to 'audio') diff --git a/audio/decode/dec_audio.c b/audio/decode/dec_audio.c index 9fe09ae89f..9e136f2e3b 100644 --- a/audio/decode/dec_audio.c +++ b/audio/decode/dec_audio.c @@ -167,7 +167,6 @@ void audio_reset_decoding(struct dec_audio *d_audio) if (d_audio->ad_driver) d_audio->ad_driver->control(d_audio, ADCTRL_RESET, NULL); d_audio->pts = MP_NOPTS_VALUE; - d_audio->pts_reset = false; talloc_free(d_audio->current_frame); d_audio->current_frame = NULL; talloc_free(d_audio->packet); @@ -183,17 +182,8 @@ static void fix_audio_pts(struct dec_audio *da) double newpts = da->current_frame->pts; // 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) { - // Attempt to detect jumps in PTS. Even for the lowest - // sample rates and with worst container rounded timestamp, - // this should be a margin more than enough. - if (da->pts != MP_NOPTS_VALUE && fabs(newpts - da->pts) > 0.1) { - MP_WARN(da, "Invalid audio PTS: %f -> %f\n", - da->pts, newpts); - da->pts_reset = true; - } + if (da->pts == MP_NOPTS_VALUE || fabs(da->pts - newpts) > 0.001) da->pts = da->current_frame->pts; - } } if (da->pts == MP_NOPTS_VALUE && da->header->missing_timestamps) diff --git a/audio/decode/dec_audio.h b/audio/decode/dec_audio.h index 27752f7be1..90451ef787 100644 --- a/audio/decode/dec_audio.h +++ b/audio/decode/dec_audio.h @@ -36,9 +36,6 @@ struct dec_audio { bool try_spdif; - // set every time a jump in timestamps is encountered - bool pts_reset; - // For free use by the ad_driver void *priv; -- cgit v1.2.3