<html><head></head><body><div class="gmail_quote">Le 27 juin 2017 10:53:04 GMT+02:00, Thomas Guillem <git@videolan.org> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">vlc | branch: master | Thomas Guillem <thomas@gllm.fr> | Tue Jun 27 10:52:05 2017 +0200| [4074b544fb288b0703f4b8160c9feed6ecb8a318] | committer: Thomas Guillem<br /><br />aout: simplify, remove unset_str[]<br /><br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> <a href="http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4074b544fb288b0703f4b8160c9feed6ecb8a318">http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4074b544fb288b0703f4b8160c9feed6ecb8a318</a><br /></blockquote>---<br /><br /> src/audio_output/output.c | 13 +++++--------<br /> 1 file changed, 5 insertions(+), 8 deletions(-)<br /><br />diff --git a/src/audio_output/output.c b/src/audio_output/output.c<br />index 8a70cdfddc..dbf4f8169d 100644<br />--- a/src/audio_output/output.c<br />+++ b/src/audio_output/output.c<br />@@ -35,8 +35,6 @@<br /> #include "libvlc.h"<br /> #include "aout_internal.h"<br /> <br />-static const char unset_str[1] = ""; /* Non-NULL constant string pointer */<br />-<br /> struct aout_dev<br /> {<br /> aout_dev_t *next;<br />@@ -189,7 +187,7 @@ audio_output_t *aout_New (vlc_object_t *parent)<br /> vlc_mutex_init (&owner->lock);<br /> vlc_mutex_init (&owner->req.lock);<br /> vlc_mutex_init (&owner->dev.lock);<br />- owner->req.device = (char *)unset_str;<br />+ owner->req.device = NULL;<br /> owner->req.volume = -1.f;<br /> owner->req.mute = -1;<br /> <br />@@ -357,7 +355,7 @@ static void aout_Destructor (vlc_object_t *obj)<br /> free (dev);<br /> }<br /> <br />- assert (owner->req.device == unset_str);<br />+ assert (owner->req.device == NULL);<br /> vlc_mutex_destroy (&owner->req.lock);<br /> vlc_mutex_destroy (&owner->lock);<br /> }<br />@@ -564,11 +562,11 @@ void aout_OutputUnlock (audio_output_t *aout)<br /> vlc_assert_locked (&owner->lock);<br /> vlc_mutex_lock (&owner->req.lock);<br /> <br />- if (owner->req.device != unset_str)<br />+ if (owner->req.device != NULL)<br /> {<br /> aout_OutputDeviceSet (aout, owner->req.device);<br /> free (owner->req.device);<br />- owner->req.device = (char *)unset_str;<br />+ owner->req.device = NULL;<br /> }<br /> <br /> if (owner->req.volume >= 0.f)<br />@@ -675,8 +673,7 @@ int aout_DeviceSet (audio_output_t *aout, const char *id)<br /> }<br /> <br /> vlc_mutex_lock (&owner->req.lock);<br />- if (owner->req.device != unset_str)<br />- free (owner->req.device);<br />+ free (owner->req.device);<br /> owner->req.device = dev;<br /> vlc_mutex_unlock (&owner->req.lock);<br /> <br /><br /><hr /><br />vlc-commits mailing list<br />vlc-commits@videolan.org<br /><a href="https://mailman.videolan.org/listinfo/vlc-commits">https://mailman.videolan.org/listinfo/vlc-commits</a><br /></pre></blockquote></div><br clear="all">IIRC, the API documentation explains why this was needed: unsetting the audio device (however the aout wants to implement it) - and you just broke it. Please revert.<br>
-- <br>
Rémi Denis-Courmont<br>
Typed on an inconvenient virtual keyboard</body></html>