summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-20 14:13:24 +0200
committerwm4 <wm4@nowhere>2014-07-20 20:13:07 +0200
commitd320695207abe9c77dff9ce1181c6db7bc2d6b27 (patch)
tree66f3773b7f751a554d3b68178bbf4380cfeb6845 /player
parent6a556f524e21fa2024d68237d2e324b3de93bd83 (diff)
downloadmpv-d320695207abe9c77dff9ce1181c6db7bc2d6b27.tar.bz2
mpv-d320695207abe9c77dff9ce1181c6db7bc2d6b27.tar.xz
command: potentially fix dvd angle setting
This called demux_flush(), but that doesn't make any sense with an asynchronously running demuxer. It would just keep reading and add new packets again. Explicitly pause the demuxer, so that this can't happen. Also, when flushing, data will be missing, so the decoders should always be reinitialized, even if the operation fails.
Diffstat (limited to 'player')
-rw-r--r--player/command.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/player/command.c b/player/command.c
index 6b29fdc735..af9350f39c 100644
--- a/player/command.c
+++ b/player/command.c
@@ -876,13 +876,12 @@ static int mp_property_angle(void *ctx, struct m_property *prop,
angle = *(int *)arg;
if (angle < 0 || angle > angles)
return M_PROPERTY_ERROR;
- demux_flush(demuxer);
+ demux_pause(demuxer);
+ demux_flush(demuxer);
ris = demux_stream_control(demuxer, STREAM_CTRL_SET_ANGLE, &angle);
- if (ris != STREAM_OK)
- return M_PROPERTY_ERROR;
-
demux_control(demuxer, DEMUXER_CTRL_RESYNC, NULL);
+ demux_unpause(demuxer);
if (mpctx->d_video)
video_reset_decoding(mpctx->d_video);
@@ -890,7 +889,7 @@ static int mp_property_angle(void *ctx, struct m_property *prop,
if (mpctx->d_audio)
audio_reset_decoding(mpctx->d_audio);
- return M_PROPERTY_OK;
+ return ris == STREAM_OK ? M_PROPERTY_OK : M_PROPERTY_ERROR;
case M_PROPERTY_GET_TYPE: {
struct m_option opt = {
.type = CONF_TYPE_INT,