summaryrefslogtreecommitdiffstats
path: root/player/audio.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-30 23:01:55 +0200
committerwm4 <wm4@nowhere>2014-07-30 23:29:00 +0200
commit8f2e9f1d613f686a834446c73465f0ca41156db3 (patch)
treedffb9d92c1764b7c6b7bd829e919e68f1be10bb1 /player/audio.c
parentc38013bffb130fbd60c57348a15ad1d6759c1806 (diff)
downloadmpv-8f2e9f1d613f686a834446c73465f0ca41156db3.tar.bz2
mpv-8f2e9f1d613f686a834446c73465f0ca41156db3.tar.xz
player: split seek_reset()
This also reduces some code duplication with other parts of the code. The changfe is mostly cosmetic, although there are also some subtle changes in behavior. At least one change is that the big desync message is now printed after every seek.
Diffstat (limited to 'player/audio.c')
-rw-r--r--player/audio.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/player/audio.c b/player/audio.c
index 5fcc2cbd22..2491051a54 100644
--- a/player/audio.c
+++ b/player/audio.c
@@ -92,6 +92,13 @@ int reinit_audio_filters(struct MPContext *mpctx)
return 1;
}
+void reset_audio_state(struct MPContext *mpctx)
+{
+ if (mpctx->d_audio)
+ audio_reset_decoding(mpctx->d_audio);
+ mpctx->audio_status = mpctx->d_audio ? STATUS_SYNCING : STATUS_EOF;
+}
+
void reinit_audio_chain(struct MPContext *mpctx)
{
struct MPOpts *opts = mpctx->opts;
@@ -117,6 +124,7 @@ void reinit_audio_chain(struct MPContext *mpctx)
mpctx->d_audio->replaygain_data = sh->audio->replaygain_data;
if (!audio_init_best_codec(mpctx->d_audio, opts->audio_decoders))
goto init_error;
+ reset_audio_state(mpctx);
}
assert(mpctx->d_audio);