<div dir="rtl"><div dir="ltr">Hello Remi,<br></div><div dir="ltr">Please see the documentation of 'pf_read' in 'stream_t' structure. (include/vlc_stream.h):</div><div dir="ltr"><br></div><div dir="ltr">\retval -1 no data available yet</div><div dir="ltr">\retval 0 end of stream (incl. fatal error)</div><div dir="ltr">\retval positive number of bytes read (no more than len)</div><div dir="ltr"><br></div><div dir="ltr">This means that return value '0' is end of stream or error.</div><div dir="ltr"><br></div><div dir="ltr">Furthermore, the implamentation of 'vlc_stream_Read' (src/input/stream.c) already waits for other value than '-1'. <br></div><div dir="ltr">Waiting for data inside the callback is redundant.</div><div dir="ltr"><br></div><div dir="ltr">Thank you.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div dir="ltr">2017-10-04 18:56 GMT+03:00 Rémi Denis-Courmont <span dir="ltr"><<a href="mailto:remi@remlab.net" target="_blank">remi@remlab.net</a>></span>:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Le keskiviikkona 4. lokakuuta 2017, 18.40.01 EEST Nir Halay a écrit :<br>
> Allow 'no data available yet' return value (-1) for 'imem-read' callback.<br>
> This fix allows more natural call to 'vlc_stream_ReadPartial' that does not<br>
> suppose to wait for data. Docs updated as well.<br>
<br>
</span>How to return an error with this? Mixing end-of-stream with error is a design<br>
BUG in the internal API, that I would rather not propagate further.<br>
<br>
Also the documentation is lacking, and the proposed API is rather quirky. You<br>
can't simply return -1 until data becomes available, as it would cause a live<br>
loop.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
雷米‧德尼-库尔蒙<br>
<a href="https://www.remlab.net/" rel="noreferrer" target="_blank">https://www.remlab.net/</a><br>
<br>
______________________________<wbr>_________________<br>
vlc-devel mailing list<br>
To unsubscribe or modify your subscription options:<br>
<a href="https://mailman.videolan.org/listinfo/vlc-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/<wbr>listinfo/vlc-devel</a></font></span></blockquote></div><br></div>