<html><head></head><body><div class="gmail_quote">Le 17 juillet 2017 23:40:13 GMT+08:00, Steve Lhomme <robux4@gmail.com> 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">On Mon, Jul 17, 2017 at 5:02 PM, Rémi Denis-Courmont <remi@remlab.net> wrote:<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> On lundi 17 juillet 2017 16:33:10 EEST Steve Lhomme wrote:<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> And add a sanity check for the ES category.<br /></blockquote><br /> I don't think this grants a new function TBH. This is such a narrow wrapper.<br /></blockquote><br />Yeah it's not big but apart from the core there are 3 modules that<br />also load a decoder. And they could/should benefit from the extra<br />safety on fmt_out when loading a module. Unfortunately there is<br />nothing that would allow creating a decoder_t directly. There's<br />input_DecoderCreate() but it depends on input_resource_t that they<br />don't have.<br /><br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> We don't usually expose such functionality - instead combining object creation<br /> and module loading.<br /><br /><br /> --<br /> Rémi Denis-Courmont<br /><hr /><br /> 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 /><br />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 clear="all">I don't really buy it. The function semantics are very tightly coupled with the calling code, especially given the callback parameter.<br>
<br>
If you want to rationalize this, the "modern" pattern defined by Laurent consists of providing an "owner" structure pointer for the callbacks and private data of the caller. This allows to keep object allocation, initialization and module probing in a single function.<br>
-- <br>
Rémi Denis-Courmont<br>
Typed on an inconvenient virtual keyboard</body></html>