From ec72cb7a73535171273013040476b165b980eaae Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Sun, 31 Jul 2011 01:05:17 +0300 Subject: core: audio: improve audio-only seeks and position reporting Seeking while paused could result in the current audio pts being reported incorrectly due to relevant variables not being reinitialized after the seek until more audio was played. When playing audio-only files, this meant that current overall playback position could be reported incorrectly which in turn could break further seeks. Improve things on two levels: First, store the seek target position and use that as the current playback position for audio-only files until things can be reinitialized. Second, try to reinitialize audio decoding enough to know its current pts even while paused. Also avoid printing the actual huge negative value of MP_NOPTS_VALUE on the status line when pts could not be determined. --- mp_core.h | 1 + 1 file changed, 1 insertion(+) (limited to 'mp_core.h') diff --git a/mp_core.h b/mp_core.h index f1194d2454..4eac430263 100644 --- a/mp_core.h +++ b/mp_core.h @@ -159,6 +159,7 @@ typedef struct MPContext { /* timestamp of video frame currently visible on screen * (or at least queued to be flipped by VO) */ double video_pts; + double last_seek_pts; // used to prevent hanging in some error cases unsigned int start_timestamp; -- cgit v1.2.3