summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-13 20:07:14 +0200
committerAlessandro Ghedini <alessandro@ghedini.me>2014-07-14 13:48:36 +0200
commit636b62fc1a34cb9b9f646875e2898806617bcabd (patch)
treee27b3d243d164499310ecd9f4156c164f90b6a83
parent78195cd74235dd53e527f075fe20cdcc94c202d4 (diff)
downloadmpv-636b62fc1a34cb9b9f646875e2898806617bcabd.tar.bz2
mpv-636b62fc1a34cb9b9f646875e2898806617bcabd.tar.xz
audio: drop buffered audio when switching tracks or filters
No reason to wait until the audio has been played. This isn't a problem with gapless audio disabled, and since gapless is now default, this behavior might be perceived as regression. CC: @mpv-player/stable
-rw-r--r--player/command.c1
-rw-r--r--player/loadfile.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/player/command.c b/player/command.c
index 6538d5e2bb..952d348af9 100644
--- a/player/command.c
+++ b/player/command.c
@@ -2995,6 +2995,7 @@ static bool reinit_filters(MPContext *mpctx, enum stream_type mediatype)
case STREAM_VIDEO:
return reinit_video_filters(mpctx) >= 0;
case STREAM_AUDIO:
+ clear_audio_output_buffers(mpctx);
return reinit_audio_filters(mpctx) >= 0;
}
return false;
diff --git a/player/loadfile.c b/player/loadfile.c
index bae8f74fe9..18d1147772 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -598,6 +598,7 @@ void mp_switch_track_n(struct MPContext *mpctx, int order, enum stream_type type
uninit |= mpctx->opts->fixed_vo && track ? 0 : INITIALIZED_VO;
uninit_player(mpctx, uninit);
} else if (type == STREAM_AUDIO) {
+ clear_audio_output_buffers(mpctx);
uninit_player(mpctx, INITIALIZED_AO | INITIALIZED_ACODEC);
} else if (type == STREAM_SUB) {
uninit_player(mpctx, INITIALIZED_SUB);