Commit 4dbb30d6 authored by mstorsjo's avatar mstorsjo

RTSP muxer: Use a local copy of the AVPacket for sending to the chained muxer

This way, we avoid overwriting stream_index in the user's AVPacket
with a nonsense value.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@22081 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 3db4fcc8
......@@ -71,6 +71,7 @@ static int rtsp_write_packet(AVFormatContext *s, AVPacket *pkt)
int n, tcp_fd;
struct timeval tv;
AVFormatContext *rtpctx;
AVPacket local_pkt;
FD_ZERO(&rfds);
tcp_fd = url_get_file_handle(rt->rtsp_hd);
......@@ -96,8 +97,11 @@ static int rtsp_write_packet(AVFormatContext *s, AVPacket *pkt)
rtsp_st = rt->rtsp_streams[pkt->stream_index];
rtpctx = rtsp_st->transport_priv;
pkt->stream_index = 0;
return av_write_frame(rtpctx, pkt);
/* Use a local packet for writing to the chained muxer, otherwise
* the internal stream_index = 0 becomes visible to the muxer user. */
local_pkt = *pkt;
local_pkt.stream_index = 0;
return av_write_frame(rtpctx, &local_pkt);
}
static int rtsp_write_close(AVFormatContext *s)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment