<!DOCTYPE html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div><br></div><div><br></div><div>On Mon, Feb 17, 2020, at 19:40, David Fuhrmann wrote:<br></div><blockquote type="cite" id="qt"><div>Hi Thomas,<br></div><div class="qt-"><br></div><div class="qt-">Thanks for your feedback.<br></div><div class="qt-"><div><div><br></div><blockquote class="qt-" type="cite"><div class="qt-">Am 17.02.2020 um 11:47 schrieb Thomas Guillem <<a class="qt-" href="mailto:thomas@gllm.fr">thomas@gllm.fr</a>>:<br></div><div><br></div><div class="qt-"><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">Hello David,</span></span></span><br></div><div><br></div><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">Sorry, I have missed your ping 17 months ago on trac...</span></span></span><br></div><div><br></div><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">The patch is OK but could be improved like that:</span></span></span><br></div><div><br></div><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">diff --git a/modules/audio_output/auhal.c b/modules/audio_output/auhal.c</span></span></span><br></div><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">index b56e609bc39..a19aac1b505 100644</span></span></span><br></div><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">--- a/modules/audio_output/auhal.c</span></span></span><br></div><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">+++ b/modules/audio_output/auhal.c</span></span></span><br></div><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">@@ -519,9 +519,6 @@ RebuildDeviceList(audio_output_t * p_aout, UInt32 *p_id_exists)</span></span></span><br></div><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">            continue;</span></span></span><br></div><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">        }</span></span></span><br></div><div><br></div><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">-        if (p_id_exists && i_id == i_id_exists)</span></span></span><br></div><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">-            *p_id_exists = i_id;</span></span></span><br></div><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">-</span></span></span><br></div></div></blockquote><blockquote class="qt-" type="cite"><div class="qt-"><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">        ReportDevice(p_aout, i_id, psz_name);</span></span></span><br></div><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">        CFNumberRef deviceNumber = CFNumberCreate(kCFAllocatorDefault,</span></span></span><br></div><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">                                                  kCFNumberSInt32Type, &i_id);</span></span></span><br></div><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">@@ -542,6 +539,9 @@ RebuildDeviceList(audio_output_t * p_aout, UInt32 *p_id_exists)</span></span></span><br></div><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">            free(psz_encoded_name);</span></span></span><br></div><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">        }</span></span></span><br></div><div><br></div><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">+        if (p_id_exists && i_id == i_id_exists)</span></span></span><br></div><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">+            *p_id_exists = i_id;</span></span></span><br></div><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">+</span></span></span><br></div></div></blockquote><div><br></div><div><br></div><div>I think your proposal will not work: In the if clause checking for digital output, we modify i_id by adding the SPDIF flag. We really need two dedicated checks, the first one to ensure to confirm the selection of a potential analog device, and the second check is needed to confirm the selection of potentially the same device, but in the digital mode. In the end both have different IDs, so they need to be handled like two different devices.<br></div></div></div></blockquote><div><br></div><div>OK, got it. Maybe a comment could be helpful then.<br></div><div><br></div><blockquote type="cite" id="qt"><div class="qt-"><div><div><br></div><blockquote class="qt-" type="cite"><div class="qt-"><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">        // TODO: only register once for each device</span></span></span><br></div><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">        ManageAudioStreamsCallback(p_aout, p_devices[i], true);</span></span></span><br></div><div><br></div><div><br></div><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">On Sat, Feb 15, 2020, at 12:37,<span class="qt-Apple-converted-space"> </span></span></span></span><a class="qt-" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;-moz-text-size-adjust:auto;-webkit-text-stroke-width:0px;" href="mailto:david.fuhrmann@gmail.com">david.fuhrmann@gmail.com</a><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size"><span class="qt-Apple-converted-space"> </span>wrote:</span></span></span><br></div><blockquote class="qt-" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;-moz-text-size-adjust:auto;-webkit-text-stroke-width:0px;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:currentcolor;text-decoration-thickness:auto;" type="cite"><div>From: David Fuhrmann <<a class="qt-" href="mailto:dfuhrmann@videolan.org">dfuhrmann@videolan.org</a>><br></div><div><br></div><div>Encoded output is stored in VLCs settings by adding the<br></div><div>AOUT_VAR_SPDIF_FLAG flag to the integer. Make sure this<br></div><div>configuration is also picked up again after restart, if it is stored<br></div><div>and actually available.<br></div><div><br></div><div>Credits: Andrey Y.<br></div><div>fixes #21170<br></div><div>---<br></div><div><br></div><div>Hello all,<br></div><div><br></div><div>Patch is taken from the user comment in #21170 and has been<span class="qt-Apple-converted-space"> </span><br></div><div>successfully tested and<br></div><div>verified by me again.<br></div><div>I asked the user in the forum (where he posted the same patch again) if<span class="qt-Apple-converted-space"> </span><br></div><div>we wants to send a git-patch to get correct authorship.<br></div><div>As he did not respond and I do not know his full name, I would apply it<br></div><div>as proposed, they are no objections.<br></div><div><br></div><div>This should be also backported for 3.0.9.<br></div><div><br></div><div>BR. David<br></div><div><br></div><div><br></div><div>modules/audio_output/auhal.c | 8 ++++++++<br></div><div>1 file changed, 8 insertions(+)<br></div><div><br></div><div>diff --git a/modules/audio_output/auhal.c b/modules/audio_output/auhal.c<br></div><div>index b56e609bc397..643c3fd19450 100644<br></div><div>--- a/modules/audio_output/auhal.c<br></div><div>+++ b/modules/audio_output/auhal.c<br></div><div>@@ -540,6 +540,9 @@ RebuildDeviceList(audio_output_t * p_aout, UInt32<span class="qt-Apple-converted-space"> </span><br></div><div>*p_id_exists)<br></div><div>            CFArrayAppendValue(currentListOfDevices, deviceNumber);<br></div><div>            CFRelease(deviceNumber);<br></div><div>            free(psz_encoded_name);<br></div><div>+<br></div><div>+            if (p_id_exists && i_id == i_id_exists)<br></div><div>+                *p_id_exists = i_id;<br></div><div>        }<br></div><div><br></div><div>        // TODO: only register once for each device<br></div><div>@@ -1749,6 +1752,11 @@ static int Open(vlc_object_t *obj)<br></div><div>    {<br></div><div>        int dev_id_int = atoi(psz_audio_device);<br></div><div>        UInt32 dev_id = dev_id_int < 0 ? 0 : dev_id_int;<br></div><div>+<br></div><div>+        bool isDigital = (dev_id & AOUT_VAR_SPDIF_FLAG) != 0;<br></div><div>+        msg_Dbg(obj, "Trying to use stored audio device %d (%s)",<br></div><div>+                (dev_id & ~AOUT_VAR_SPDIF_FLAG), isDigital ? "digital"<span class="qt-Apple-converted-space"> </span><br></div><div>: "analog");<br></div></blockquote><div><br></div><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">Also, this should be in a separate commit.</span></span></span><br></div></div></blockquote><div><br></div><div>Sure, will split that up before merging.<br></div></div></div></blockquote><div><br></div><div>Thanks!<br></div><div><br></div><blockquote type="cite" id="qt"><div class="qt-"><div><div>BR. David<br></div><div><br></div><blockquote class="qt-" type="cite"><div class="qt-"><div><br></div><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">I'm OK for a backport (before the upcoming release).</span></span></span><br></div><div><br></div><div><br></div><blockquote class="qt-" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;-moz-text-size-adjust:auto;-webkit-text-stroke-width:0px;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:currentcolor;text-decoration-thickness:auto;" type="cite"><div>+<br></div><div>        RebuildDeviceList(p_aout, &dev_id);<br></div><div>        p_sys->i_new_selected_dev = dev_id;<br></div><div>        free(psz_audio_device);<br></div><div>--<span class="qt-Apple-converted-space"> </span><br></div><div>2.21.1 (Apple Git-122.3)<br></div><div><br></div><div>_______________________________________________<br></div><div>vlc-devel mailing list<br></div><div>To unsubscribe or modify your subscription options:<br></div><div><a class="qt-" href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></div></blockquote><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">_______________________________________________</span></span></span><br></div><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">vlc-devel mailing list</span></span></span><br></div><div><span class="qt-" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;"><span style="font-family:Helvetica" class="font"><span style="font-size:12px" class="size">To unsubscribe or modify your subscription options:</span></span></span><br></div><div><a class="qt-" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;-moz-text-size-adjust:auto;-webkit-text-stroke-width:0px;" href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></div></div></blockquote></div></div><div>_______________________________________________<br></div><div>vlc-devel mailing list<br></div><div>To unsubscribe or modify your subscription options:<br></div><div>https://mailman.videolan.org/listinfo/vlc-devel<br></div></blockquote><div><br></div></body></html>