[FFmpeg-devel] [PATCH] udp: ignore UDP packets without payload

Daniel Kučera daniel.kucera at gmail.com
Wed May 24 11:10:57 EEST 2017


2017-05-24 9:02 GMT+02:00 Nicolas George <george at nsup.org>:
>
> Le quartidi 4 prairial, an CCXXV, Daniel Kucera a écrit :
> > Time to time some devices send UDP packets without payload.
> > ffmpeg previously exited on receiving such packet, this patch
> > fixes this behaviour.
> >
> > Signed-off-by: Daniel Kucera <daniel.kucera at gmail.com>
> > ---
> >  libavformat/udp.c | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
>
> I do not think this is correct: UDP is a packetized protocol, packet
> with empty payload are still packets, and meaningful for some protocols.
>
> Regards,
>
> --
>   Nicolas George


Maybe, but in libavformat/async.c is zero treated as EOF:

ret = ring_generic_write(ring, (void *)h, to_copy, wrapped_url_read);
pthread_mutex_lock(&c->mutex);
if (ret <= 0) {
c->io_eof_reached = 1;
if (c->inner_io_error < 0)
c->io_error = c->inner_io_error;
}

So what do you suggest?


S pozdravom / Best regards
Daniel Kucera.


More information about the ffmpeg-devel mailing list