aboutsummaryrefslogtreecommitdiffhomepage
path: root/audio/decode
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2016-01-29 22:44:20 +0100
committerGravatar wm4 <wm4@nowhere>2016-01-29 22:44:20 +0100
commitc5a48c63321de00bb8cb6b91a8d6ed22caa3b36f (patch)
treeb01e6e28b78819a782119049bcbfa717ed88aa75 /audio/decode
parent340deb4e6eb1cf09c19cef5bd19c7eab51d6862b (diff)
audio: move pts reset check
Reduces the dependency of the filter/output code on the decoder.
Diffstat (limited to 'audio/decode')
-rw-r--r--audio/decode/dec_audio.c12
-rw-r--r--audio/decode/dec_audio.h3
2 files changed, 1 insertions, 14 deletions
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;