<html><head></head><body>Hi,<br><br>If the user cycles rapidly, e.g. by holding the hotkey, the input control queue will overflow, AFAIR. So this series does not really solve that corner case, AFAICT.<br><br>If you really want a race free system, you need to store the signed offset (in number of tracks) from the default selection to the user selection in the ES output, and an accumulator in the input state to avoid filling the control queue with multiple track change requests.<br>This will have a major impact on the ES output internals though.<br><br><div class="gmail_quote">Le 14 novembre 2018 19:13:43 GMT+02:00, Thomas Guillem <thomas@gllm.fr> 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"><br>On Wed, Nov 14, 2018, at 17:59, Rémi Denis-Courmont wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">Le keskiviikkona 14. marraskuuta 2018, 18.50.15 EET Thomas Guillem a écrit :<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;">With 2 new internal controls: ES_OUT_SET_ES_NEXT and ES_OUT_SET_ES_PREV.<br>This will fix a TOCTOU issue when selecting next or previous tracks.<br></blockquote>What ToCToU issue? If a track is added or removed at about the same time as <br>the user cycles, there is an intrinsic race. Intrinsic races can. by <br>definition, not be fixed.<br></blockquote><br>TOCTOU if the user cycles tracks rapidly. Some controls could be dropped in that case. If the user press 3 times the next track button, you want to be sure to select the fourth track.<br>This is far more visible with programs that can take a longer time to initialize.<br><br>This also prevent cycling if the es_out policy is ES_OUT_ES_POLICY_SIMULTANEOUS. You can't really do something clever if there are more than one tracks selected for a same category, so it's better to do nothing.<br><br>If this patch is not accepted, I'll have to cycle through ES tracks from the client side and this won't prevent weird behavior in case of ES_OUT_ES_POLICY_SIMULTANEOUS.<br><br><br>> <br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">For instance, this will still select a track one microsecond before it ends. <br>From the user's point of view, that's no better than selecting a track that <br>ended one microsecond ago.<br><br>Of coruse, the engine must be robust and must not trigger UB, not even on <br>intrinsic races. As far as I know, the new ES reference counting already <br>solve that. But the timing-dependent behaviour cannot be avoided here. So I <br>would rather not add hopeless complexity.<br><br>-- <br>雷米‧德尼-库尔蒙<br><a href="http://www.remlab.net/">http://www.remlab.net/</a><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></blockquote><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>