rtsp: udp_read_packet returning 0 doesn't mean success
authorMartin Storsjö <martin@martin.st>
Wed, 16 Feb 2011 12:35:47 +0000 (14:35 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 18 Feb 2011 18:52:26 +0000 (19:52 +0100)
If udp_read_packet returns 0, rtsp_st isn't set and we shouldn't
treat it as a successfully received packet (which is counted and
possibly triggers a RTCP receiver report).

This fixes issue 2612.
(cherry picked from commit 2c35a6bde95a382e2d48570255deb67a7633fa46)

libavformat/rtsp.c

index 41427ae..d828c8d 100644 (file)
@@ -1681,7 +1681,7 @@ int ff_rtsp_fetch_packet(AVFormatContext *s, AVPacket *pkt)
     case RTSP_LOWER_TRANSPORT_UDP:
     case RTSP_LOWER_TRANSPORT_UDP_MULTICAST:
         len = udp_read_packet(s, &rtsp_st, rt->recvbuf, RECVBUF_SIZE, wait_end);
-        if (len >=0 && rtsp_st->transport_priv && rt->transport == RTSP_TRANSPORT_RTP)
+        if (len > 0 && rtsp_st->transport_priv && rt->transport == RTSP_TRANSPORT_RTP)
             rtp_check_and_send_back_rr(rtsp_st->transport_priv, len);
         break;
     }