From: Jan Sebechlebsky <sebechlebsky...@gmail.com> This will fix crash when caller attempts to flush by calling write_packet with NULL packet pointer and flushes slaves as expected.
Signed-off-by: Jan Sebechlebsky <sebechlebsky...@gmail.com> --- libavformat/tee.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libavformat/tee.c b/libavformat/tee.c index a56d449..996d64d 100644 --- a/libavformat/tee.c +++ b/libavformat/tee.c @@ -520,6 +520,17 @@ static int tee_write_packet(AVFormatContext *avf, AVPacket *pkt) if (!(avf2 = tee->slaves[i].avf)) continue; + /* Flush slave if pkt is NULL*/ + if (!pkt) { + ret = av_interleaved_write_frame(avf2, NULL); + if (ret < 0) { + ret = tee_process_slave_failure(avf, i, ret); + if (!ret_all && ret < 0) + ret_all = ret; + } + continue; + } + s = pkt->stream_index; s2 = tee->slaves[i].stream_map[s]; if (s2 < 0) -- 1.9.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel