diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-13 15:43:01 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-13 15:44:13 +0100 |
commit | 4facddd568b7b6c0014b4a0da157b8ba8f3e3b1a (patch) | |
tree | 71a83fc1da6cc08e5f81c3b1e60e9329ac6c3c52 /libavformat | |
parent | 327cd0d09b459bcc9996cd864bf8569788d70b5b (diff) | |
download | ffmpeg-4facddd568b7b6c0014b4a0da157b8ba8f3e3b1a.tar.gz |
mpegts: dont set stream info when a decoder has already been opened.
Fixes assertion failure.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mpegts.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index b4380a6ea9..946e31ab7b 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -613,6 +613,12 @@ static int mpegts_set_stream_info(AVStream *st, PESContext *pes, { int old_codec_type= st->codec->codec_type; int old_codec_id = st->codec->codec_id; + + if (old_codec_id != AV_CODEC_ID_NONE && avcodec_is_open(st->codec)) { + av_log(pes->stream, AV_LOG_DEBUG, "cannot set stream info, codec is open\n"); + return 0; + } + avpriv_set_pts_info(st, 33, 1, 90000); st->priv_data = pes; st->codec->codec_type = AVMEDIA_TYPE_DATA; |