[vlc-devel] [PATCH] Allow 'no data available yet' for imem callback

ניר הלאי nirhalay at gmail.com
Wed Oct 4 18:11:59 CEST 2017


Hello Remi,
Please see the documentation of 'pf_read' in 'stream_t' structure.
(include/vlc_stream.h):

\retval -1 no data available yet
\retval 0 end of stream (incl. fatal error)
\retval positive number of bytes read (no more than len)

This means that return value '0' is end of stream or error.

Furthermore, the implamentation of 'vlc_stream_Read' (src/input/stream.c)
already waits for other value than '-1'.
Waiting for data inside the callback is redundant.

Thank you.

2017-10-04 18:56 GMT+03:00 Rémi Denis-Courmont <remi at remlab.net>:

> Le keskiviikkona 4. lokakuuta 2017, 18.40.01 EEST Nir Halay a écrit :
> > Allow 'no data available yet' return value (-1) for 'imem-read' callback.
> > This fix allows more natural call to 'vlc_stream_ReadPartial' that does
> not
> > suppose to wait for data. Docs updated as well.
>
> How to return an error with this? Mixing end-of-stream with error is a
> design
> BUG in the internal API, that I would rather not propagate further.
>
> Also the documentation is lacking, and the proposed API is rather quirky.
> You
> can't simply return -1 until data becomes available, as it would cause a
> live
> loop.
>
> --
> 雷米‧德尼-库尔蒙
> https://www.remlab.net/
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20171004/bb81a21c/attachment.html>


More information about the vlc-devel mailing list