For example MS-RTSP doesn't have RTPDemuxContexts for all streams. This fixes issue 2448. Originally committed as revision 26107 to svn://svn.ffmpeg.org/ffmpeg/trunk
Unified · Split
| @@ -1557,7 +1557,10 @@ int ff_rtsp_fetch_packet(AVFormatContext *s, AVPacket *pkt) · 1556 unmodified lines | ||
| 1557 | 1557 | int64_t first_queue_time = 0; |
| 1558 | 1558 | for (i = 0; i < rt->nb_rtsp_streams; i++) { |
| 1559 | 1559 | RTPDemuxContext *rtpctx = rt->rtsp_streams[i]->transport_priv; |
| 1560 | − int64_t queue_time = ff_rtp_queued_packet_time(rtpctx); | |
| 1560 | + int64_t queue_time; | |
| 1561 | + if (!rtpctx) | |
| 1562 | + continue; | |
| 1563 | + queue_time = ff_rtp_queued_packet_time(rtpctx); | |
| 1561 | 1564 | if (queue_time && (queue_time - first_queue_time < 0 || |
| 1562 | 1565 | !first_queue_time)) { |
| 1563 | 1566 | first_queue_time = queue_time; |