libavformat/rtsp.c:1790: error: Uninitialized Value
  The value read from ret was never initialized.

libavformat/rtsp.c:1790:13: 
1788.             }
1789.         }
1790.         if (ret == 0) {
                  ^
1791.             rt->cur_transport_priv = NULL;
1792.             return 0;

int ff_rtsp_fetch_packet(AVFormatContext *s, AVPacket *pkt)
{
    RTSPState *rt = s->priv_data;
    int ret, len;
    RTSPStream *rtsp_st, *first_queue_st = NULL;
    int64_t wait_end = 0;
    if (rt->nb_byes == rt->nb_rtsp_streams)
        return AVERROR_EOF;
    if (rt->cur_transport_priv) {
        if (rt->transport == RTSP_TRANSPORT_RDT) {
            ret = ff_rdt_parse_packet(rt->cur_transport_priv, pkt, NULL, 0);
        } else if (rt->transport == RTSP_TRANSPORT_RTP) {
            ret = ff_rtp_parse_packet(rt->cur_transport_priv, pkt, NULL, 0);
        } else if (rt->ts && CONFIG_RTPDEC) {
            ret = ff_mpegts_parse_packet(rt->ts, pkt, rt->recvbuf + rt->recvbuf_pos, rt->recvbuf_len - rt->recvbuf_pos);
            if (ret >= 0) {
                rt->recvbuf_pos += ret;
                ret = rt->recvbuf_pos < rt->recvbuf_len;
            }
        }
        if (ret == 0) {
            rt->cur_transport_priv = NULL;
            return 0;
        } else if (ret == 1) {
            return 0;
        } else
            rt->cur_transport_priv = NULL;
    }
    if (rt->transport == RTSP_TRANSPORT_RTP) {
        int i;
        int64_t first_queue_time = 0;
        for (i = 0; i < rt->nb_rtsp_streams; i++) {
            RTPDemuxContext *rtpctx = rt->rtsp_streams[i]->transport_priv;
            int64_t queue_time;
            if (!rtpctx)
                continue;
            queue_time = ff_rtp_queued_packet_time(rtpctx);
            if (queue_time && (queue_time - first_queue_time < 0 ||
                               !first_queue_time)) {
                first_queue_time = queue_time;
                first_queue_st   = rt->rtsp_streams[i];
            }
        }
        if (first_queue_time)
            wait_end = first_queue_time + s->max_delay;
    }
 redo:
    if (!rt->recvbuf) {
        rt->recvbuf = av_malloc(RECVBUF_SIZE);
        if (!rt->recvbuf)
            return AVERROR(ENOMEM);
    }
    switch(rt->lower_transport) {
    default:
#if CONFIG_RTSP_DEMUXER
    case RTSP_LOWER_TRANSPORT_TCP:
        len = ff_rtsp_tcp_read_packet(s, &rtsp_st, rt->recvbuf, RECVBUF_SIZE);
        break;
#endif
    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)
            ff_rtp_check_and_send_back_rr(rtsp_st->transport_priv, len);
        break;
    }
    if (len == AVERROR(EAGAIN) && first_queue_st &&
        rt->transport == RTSP_TRANSPORT_RTP) {
        rtsp_st = first_queue_st;
        ret = ff_rtp_parse_packet(rtsp_st->transport_priv, pkt, NULL, 0);
        goto end;
    }
    if (len < 0)
        return len;
    if (len == 0)
        return AVERROR_EOF;
    if (rt->transport == RTSP_TRANSPORT_RDT) {
        ret = ff_rdt_parse_packet(rtsp_st->transport_priv, pkt, &rt->recvbuf, len);
    } else if (rt->transport == RTSP_TRANSPORT_RTP) {
        ret = ff_rtp_parse_packet(rtsp_st->transport_priv, pkt, &rt->recvbuf, len);
        if (ret < 0) {
            RTPDemuxContext *rtpctx = rtsp_st->transport_priv;
            if (rtpctx->first_rtcp_ntp_time != AV_NOPTS_VALUE) {
                int i;
                AVStream *st = NULL;
                if (rtsp_st->stream_index >= 0)
                    st = s->streams[rtsp_st->stream_index];
                for (i = 0; i < rt->nb_rtsp_streams; i++) {
                    RTPDemuxContext *rtpctx2 = rt->rtsp_streams[i]->transport_priv;
                    AVStream *st2 = NULL;
                    if (rt->rtsp_streams[i]->stream_index >= 0)
                        st2 = s->streams[rt->rtsp_streams[i]->stream_index];
                    if (rtpctx2 && st && st2 &&
                        rtpctx2->first_rtcp_ntp_time == AV_NOPTS_VALUE) {
                        rtpctx2->first_rtcp_ntp_time = rtpctx->first_rtcp_ntp_time;
                        rtpctx2->rtcp_ts_offset = av_rescale_q(
                            rtpctx->rtcp_ts_offset, st->time_base,
                            st2->time_base);
                    }
                }
            }
            if (ret == -RTCP_BYE) {
                rt->nb_byes++;
                av_log(s, AV_LOG_DEBUG, "Received BYE for stream %d (%d/%d)\n",
                       rtsp_st->stream_index, rt->nb_byes, rt->nb_rtsp_streams);
                if (rt->nb_byes == rt->nb_rtsp_streams)
                    return AVERROR_EOF;
            }
        }
    } else if (rt->ts && CONFIG_RTPDEC) {
        ret = ff_mpegts_parse_packet(rt->ts, pkt, rt->recvbuf, len);
        if (ret >= 0) {
            if (ret < len) {
                rt->recvbuf_len = len;
                rt->recvbuf_pos = ret;
                rt->cur_transport_priv = rt->ts;
                return 1;
            } else {
                ret = 0;
            }
        }
    } else {
        return AVERROR_INVALIDDATA;
    }
end:
    if (ret < 0)
        goto redo;
    if (ret == 1)
        rt->cur_transport_priv = rtsp_st->transport_priv;
    return ret;
}
['int ff_rtsp_fetch_packet(AVFormatContext *s, AVPacket *pkt)\n{\n    RTSPState *rt = s->priv_data;\n    int ret, len;\n    RTSPStream *rtsp_st, *first_queue_st = NULL;\n    int64_t wait_end = 0;\n    if (rt->nb_byes == rt->nb_rtsp_streams)\n        return AVERROR_EOF;\n    if (rt->cur_transport_priv) {\n        if (rt->transport == RTSP_TRANSPORT_RDT) {\n            ret = ff_rdt_parse_packet(rt->cur_transport_priv, pkt, NULL, 0);\n        } else if (rt->transport == RTSP_TRANSPORT_RTP) {\n            ret = ff_rtp_parse_packet(rt->cur_transport_priv, pkt, NULL, 0);\n        } else if (rt->ts && CONFIG_RTPDEC) {\n            ret = ff_mpegts_parse_packet(rt->ts, pkt, rt->recvbuf + rt->recvbuf_pos, rt->recvbuf_len - rt->recvbuf_pos);\n            if (ret >= 0) {\n                rt->recvbuf_pos += ret;\n                ret = rt->recvbuf_pos < rt->recvbuf_len;\n            }\n        }\n        if (ret == 0) {\n            rt->cur_transport_priv = NULL;\n            return 0;\n        } else if (ret == 1) {\n            return 0;\n        } else\n            rt->cur_transport_priv = NULL;\n    }\n    if (rt->transport == RTSP_TRANSPORT_RTP) {\n        int i;\n        int64_t first_queue_time = 0;\n        for (i = 0; i < rt->nb_rtsp_streams; i++) {\n            RTPDemuxContext *rtpctx = rt->rtsp_streams[i]->transport_priv;\n            int64_t queue_time;\n            if (!rtpctx)\n                continue;\n            queue_time = ff_rtp_queued_packet_time(rtpctx);\n            if (queue_time && (queue_time - first_queue_time < 0 ||\n                               !first_queue_time)) {\n                first_queue_time = queue_time;\n                first_queue_st   = rt->rtsp_streams[i];\n            }\n        }\n        if (first_queue_time)\n            wait_end = first_queue_time + s->max_delay;\n    }\n redo:\n    if (!rt->recvbuf) {\n        rt->recvbuf = av_malloc(RECVBUF_SIZE);\n        if (!rt->recvbuf)\n            return AVERROR(ENOMEM);\n    }\n    switch(rt->lower_transport) {\n    default:\n#if CONFIG_RTSP_DEMUXER\n    case RTSP_LOWER_TRANSPORT_TCP:\n        len = ff_rtsp_tcp_read_packet(s, &rtsp_st, rt->recvbuf, RECVBUF_SIZE);\n        break;\n#endif\n    case RTSP_LOWER_TRANSPORT_UDP:\n    case RTSP_LOWER_TRANSPORT_UDP_MULTICAST:\n        len = udp_read_packet(s, &rtsp_st, rt->recvbuf, RECVBUF_SIZE, wait_end);\n        if (len > 0 && rtsp_st->transport_priv && rt->transport == RTSP_TRANSPORT_RTP)\n            ff_rtp_check_and_send_back_rr(rtsp_st->transport_priv, len);\n        break;\n    }\n    if (len == AVERROR(EAGAIN) && first_queue_st &&\n        rt->transport == RTSP_TRANSPORT_RTP) {\n        rtsp_st = first_queue_st;\n        ret = ff_rtp_parse_packet(rtsp_st->transport_priv, pkt, NULL, 0);\n        goto end;\n    }\n    if (len < 0)\n        return len;\n    if (len == 0)\n        return AVERROR_EOF;\n    if (rt->transport == RTSP_TRANSPORT_RDT) {\n        ret = ff_rdt_parse_packet(rtsp_st->transport_priv, pkt, &rt->recvbuf, len);\n    } else if (rt->transport == RTSP_TRANSPORT_RTP) {\n        ret = ff_rtp_parse_packet(rtsp_st->transport_priv, pkt, &rt->recvbuf, len);\n        if (ret < 0) {\n            RTPDemuxContext *rtpctx = rtsp_st->transport_priv;\n            if (rtpctx->first_rtcp_ntp_time != AV_NOPTS_VALUE) {\n                int i;\n                AVStream *st = NULL;\n                if (rtsp_st->stream_index >= 0)\n                    st = s->streams[rtsp_st->stream_index];\n                for (i = 0; i < rt->nb_rtsp_streams; i++) {\n                    RTPDemuxContext *rtpctx2 = rt->rtsp_streams[i]->transport_priv;\n                    AVStream *st2 = NULL;\n                    if (rt->rtsp_streams[i]->stream_index >= 0)\n                        st2 = s->streams[rt->rtsp_streams[i]->stream_index];\n                    if (rtpctx2 && st && st2 &&\n                        rtpctx2->first_rtcp_ntp_time == AV_NOPTS_VALUE) {\n                        rtpctx2->first_rtcp_ntp_time = rtpctx->first_rtcp_ntp_time;\n                        rtpctx2->rtcp_ts_offset = av_rescale_q(\n                            rtpctx->rtcp_ts_offset, st->time_base,\n                            st2->time_base);\n                    }\n                }\n            }\n            if (ret == -RTCP_BYE) {\n                rt->nb_byes++;\n                av_log(s, AV_LOG_DEBUG, "Received BYE for stream %d (%d/%d)\\n",\n                       rtsp_st->stream_index, rt->nb_byes, rt->nb_rtsp_streams);\n                if (rt->nb_byes == rt->nb_rtsp_streams)\n                    return AVERROR_EOF;\n            }\n        }\n    } else if (rt->ts && CONFIG_RTPDEC) {\n        ret = ff_mpegts_parse_packet(rt->ts, pkt, rt->recvbuf, len);\n        if (ret >= 0) {\n            if (ret < len) {\n                rt->recvbuf_len = len;\n                rt->recvbuf_pos = ret;\n                rt->cur_transport_priv = rt->ts;\n                return 1;\n            } else {\n                ret = 0;\n            }\n        }\n    } else {\n        return AVERROR_INVALIDDATA;\n    }\nend:\n    if (ret < 0)\n        goto redo;\n    if (ret == 1)\n        rt->cur_transport_priv = rtsp_st->transport_priv;\n    return ret;\n}']