Re: [FFmpeg-devel] [PATCH] rtsp: only break on parse_rtsp_message on error

2017-12-03 Thread Tristan Matthews
On Sat, Dec 2, 2017 at 11:01 AM, Michael Niedermayer
 wrote:
> On Fri, Dec 01, 2017 at 04:09:15PM -0500, Tristan Matthews wrote:
>> Fix suggested by Luca Barbato.
>>
>> This was causing spurious EOFs when using -rtsp_transport udp, as
>> reported in https://bugzilla.libav.org/show_bug.cgi?id=1103
>> ---
>>  libavformat/rtsp.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> where is the code which interprets 0 as EOF ?

udp_read_packet is called here:
http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavformat/rtsp.c;h=b6da61b95e6c0ecce63d1d86e2b8fe7066ee2f96;hb=HEAD#l2082

which in turn, calls rtsp_parse_message here:
http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavformat/rtsp.c;h=b6da61b95e6c0ecce63d1d86e2b8fe7066ee2f96;hb=HEAD#l2010

which returns 0 in the non-error case here:
http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavformat/rtsp.c;h=b6da61b95e6c0ecce63d1d86e2b8fe7066ee2f96;hb=HEAD#l1945

this is then interpreted as an EOF here
http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavformat/rtsp.c;h=b6da61b95e6c0ecce63d1d86e2b8fe7066ee2f96;hb=HEAD#l2098

Best,
Tristan

> also nicolas may want to look at this, he was working on EOF vs 0 issues
> (thus ccing nicolas)
>
> thanks
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> it is not once nor twice but times without number that the same ideas make
> their appearance in the world. -- Aristotle
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] rtsp: only break on parse_rtsp_message on error

2017-12-02 Thread Michael Niedermayer
On Fri, Dec 01, 2017 at 04:09:15PM -0500, Tristan Matthews wrote:
> Fix suggested by Luca Barbato.
> 
> This was causing spurious EOFs when using -rtsp_transport udp, as
> reported in https://bugzilla.libav.org/show_bug.cgi?id=1103
> ---
>  libavformat/rtsp.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

where is the code which interprets 0 as EOF ?
also nicolas may want to look at this, he was working on EOF vs 0 issues
(thus ccing nicolas)

thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] rtsp: only break on parse_rtsp_message on error

2017-12-01 Thread Tristan Matthews
Fix suggested by Luca Barbato.

This was causing spurious EOFs when using -rtsp_transport udp, as
reported in https://bugzilla.libav.org/show_bug.cgi?id=1103
---
 libavformat/rtsp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index b6da61b95e..cf7cdb2f2b 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -2009,7 +2009,9 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream 
**prtsp_st,
 }
 #if CONFIG_RTSP_DEMUXER
 if (rt->rtsp_hd && p[0].revents & POLLIN) {
-return parse_rtsp_message(s);
+if ((ret = parse_rtsp_message(s)) < 0) {
+return ret;
+}
 }
 #endif
 } else if (n == 0 && ++timeout_cnt >= MAX_TIMEOUTS) {
-- 
2.14.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel