From 21f52aeeba2e8462c609006317251417ad9f3db3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 23 Aug 2014 11:39:07 +0200 Subject: audio: minor improvements to timeline switching In theory, timestamps can be negative, so we shouldn't just return -1 as special value. Remove the separate code for clearing decode buffers; use the same code that is used for normal seek reset. --- player/playloop.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'player/playloop.c') diff --git a/player/playloop.c b/player/playloop.c index 2e4cfc43ab..4cf8407812 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -188,13 +188,13 @@ static int mp_seek(MPContext *mpctx, struct seek_params seek, bool need_reset = false; demuxer_amount = timeline_set_from_time(mpctx, seek.amount, &need_reset); - if (demuxer_amount == -1) { + if (demuxer_amount == MP_NOPTS_VALUE) { assert(!need_reset); mpctx->stop_play = AT_END_OF_FILE; - if (mpctx->d_audio && !timeline_fallthrough) { - // Seek outside of the file -> clear audio from current position - clear_audio_decode_buffers(mpctx); + // When seeking outside of the file, but not when ending last segment. + if (!timeline_fallthrough) { clear_audio_output_buffers(mpctx); + reset_playback_state(mpctx); } return -1; } -- cgit v1.2.3