2017-05-23 20:44 GMT+02:00 Daniel Kucera <daniel.kuc...@gmail.com>: > 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.kuc...@gmail.com> > --- > libavformat/udp.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/libavformat/udp.c b/libavformat/udp.c > index 3835f989c4..28fa7b2354 100644 > --- a/libavformat/udp.c > +++ b/libavformat/udp.c > @@ -1039,7 +1039,11 @@ static int udp_read(URLContext *h, uint8_t *buf, int > size) > av_fifo_generic_read(s->fifo, buf, avail, NULL); > av_fifo_drain(s->fifo, AV_RL32(tmp) - avail); > pthread_mutex_unlock(&s->mutex); > - return avail; > + if (avail > 0){ > + return avail; > + } else { > + continue; > + } > } else if(s->circular_buffer_error){ > int err = s->circular_buffer_error; > pthread_mutex_unlock(&s->mutex); > -- > 2.11.0 >
Can anyone please review my patch? Thank you. S pozdravom / Best regards Daniel Kucera. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel