diff options
author | wm4 <wm4@nowhere> | 2014-11-08 16:09:42 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-11-08 16:09:42 +0100 |
commit | 33b57f55573e658b3af6c6e8ff3188c8f959e82e (patch) | |
tree | 29e31a9689f45f8854679dee6f0eb1b3fe95df14 /player/audio.c | |
parent | 68ecbdf92049675997fe0c4f5de4ac7de9958840 (diff) | |
download | mpv-33b57f55573e658b3af6c6e8ff3188c8f959e82e.tar.bz2 mpv-33b57f55573e658b3af6c6e8ff3188c8f959e82e.tar.xz |
player: improve audio time display
This commit fixes a "cosmetic" user interface issue. Instead of
displaying the interpolated seek time on OSD, show the actual audio
time.
This is rather silly: when seeking in audio-only mode, it takes some
iterations until audio is "ready", but on the other hand, the audio
state machine is rather fickle, and fixing this cosmetic issue would be
intrusive. So just add a hack that paints over the ugly behavior as
perceived by the user. Probably the lesser evil.
It doesn't happen if video is enabled, because that mode sets the
current time immediately to video PTS. (Audio has to be synced to video,
so the code is a bit more complex.)
Fixes #1233.
Diffstat (limited to 'player/audio.c')
-rw-r--r-- | player/audio.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/player/audio.c b/player/audio.c index 8274399f67..75989bfe20 100644 --- a/player/audio.c +++ b/player/audio.c @@ -429,7 +429,7 @@ static bool get_sync_samples(struct MPContext *mpctx, int *skip) return true; } -void fill_audio_out_buffers(struct MPContext *mpctx, double endpts) +static void do_fill_audio_out_buffers(struct MPContext *mpctx, double endpts) { struct MPOpts *opts = mpctx->opts; struct dec_audio *d_audio = mpctx->d_audio; @@ -589,6 +589,15 @@ void fill_audio_out_buffers(struct MPContext *mpctx, double endpts) } } +void fill_audio_out_buffers(struct MPContext *mpctx, double endpts) +{ + do_fill_audio_out_buffers(mpctx, endpts); + // Run audio playback state machine again to display the actual audio PTS + // as current time on OSD in audio-only mode in most situations. + if (mpctx->audio_status == STATUS_SYNCING) + do_fill_audio_out_buffers(mpctx, endpts); +} + // Drop data queued for output, or which the AO is currently outputting. void clear_audio_output_buffers(struct MPContext *mpctx) { |