Discussion:
aout: don't restart the decoder when changing stereo-mode
(too old to reply)
Thomas Guillem
2017-07-17 11:54:01 UTC
Permalink
Raw Message
vlc | branch: master | Thomas Guillem <***@gllm.fr> | Mon Jul 17 13:50:18 2017 +0200| [ccae20b077f9f9aa1b2c3e2a6aca54c0fe4c7e86] | committer: Thomas Guillem

aout: don't restart the decoder when changing stereo-mode
http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ccae20b077f9f9aa1b2c3e2a6aca54c0fe4c7e86
---

include/vlc_aout.h | 1 +
src/audio_output/dec.c | 7 +++++--
src/audio_output/output.c | 2 +-
3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/include/vlc_aout.h b/include/vlc_aout.h
index c6688df531..bac3de447e 100644
--- a/include/vlc_aout.h
+++ b/include/vlc_aout.h
@@ -219,6 +219,7 @@ static const uint32_t pi_vlc_chan_order_wg4[] =

#define AOUT_RESTART_FILTERS 0x1
#define AOUT_RESTART_OUTPUT (AOUT_RESTART_FILTERS|0x2)
+#define AOUT_RESTART_STEREOMODE (AOUT_RESTART_OUTPUT|0x4)

/*****************************************************************************
* Prototypes
diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c
index cc377521f1..fb5da52102 100644
--- a/src/audio_output/dec.c
+++ b/src/audio_output/dec.c
@@ -162,8 +162,11 @@ static int aout_CheckReady (audio_output_t *aout)
owner->mixer_format.i_format);

/* Notify the decoder that the aout changed in order to try a new
- * suitable codec (like an HDMI audio format). */
- status = AOUT_DEC_CHANGED;
+ * suitable codec (like an HDMI audio format). However, keep the
+ * same codec if the aout was restarted because of a stereo-mode
+ * change from the user. */
+ if (!(restart & AOUT_RESTART_STEREOMODE))
+ status = AOUT_DEC_CHANGED;
}

msg_Dbg (aout, "restarting filters...");
diff --git a/src/audio_output/output.c b/src/audio_output/output.c
index fdee815930..6b1ddc7de2 100644
--- a/src/audio_output/output.c
+++ b/src/audio_output/output.c
@@ -177,7 +177,7 @@ static int StereoModeCallback (vlc_object_t *obj, const char *varname,
audio_output_t *aout = (audio_output_t *)obj;
(void)varname; (void)oldval; (void)newval; (void)data;

- aout_RestartRequest (aout, AOUT_RESTART_OUTPUT);
+ aout_RestartRequest (aout, AOUT_RESTART_STEREOMODE);
return 0;
}

Loading...