[FFmpeg-devel] Patch for the ticket #3127 (Video stream publishing via RTMPT)

Lukasz M lukasz.m.luki at gmail.com
Fri Nov 15 20:39:04 CET 2013

On 15 November 2013 19:03, Valeriy Argunov <hzdbyte at gmail.com> wrote:

> I've found that "ffurl_read" can return 0 by the specification:
> /**
>  * Read up to size bytes from the resource accessed by h, and store
>  * the read bytes in buf.
>  *
>  * @return The number of bytes actually read, or a negative value
>  * corresponding to an AVERROR code in case of error. A value of zero
>  * indicates that it is not possible to read more from the accessed
>  * resource (except if the value of the size argument is also zero).
>  */
> int ffurl_read(URLContext *h, unsigned char *buf, int size);
> So the right patch must check "ffurl_read" result on 0, and the old patch
> is invalid.
> Here is a new patch.

I can't remember exactly what it was, but I was struggling similar problem
implementing ftp protocol.
System read function doesn't return error when reading beyond end of file
but returns 0.
You can even seek beyond end of file and after read you also get 0.
This wrapper simulates this behavior and fix should be done in the protocol

Second patch look OK for me.

More information about the ffmpeg-devel mailing list