summaryrefslogtreecommitdiffstats
path: root/mp_core.h
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-07-31 01:05:17 +0300
committerUoti Urpala <uau@mplayer2.org>2011-07-31 01:06:12 +0300
commitec72cb7a73535171273013040476b165b980eaae (patch)
tree0f4f94a848be8dc9f8bd38c3f7b7844ab4eb3a25 /mp_core.h
parentf1bb6fde3288cbbaf01175b980b9704f9406ce80 (diff)
downloadmpv-ec72cb7a73535171273013040476b165b980eaae.tar.bz2
mpv-ec72cb7a73535171273013040476b165b980eaae.tar.xz
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.
Diffstat (limited to 'mp_core.h')
-rw-r--r--mp_core.h1
1 files changed, 1 insertions, 0 deletions
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;