summaryrefslogtreecommitdiff
path: root/libavformat/mpegts.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-03 17:34:38 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-03 17:34:38 +0100
commit03290ffb57b25734120024e6943c7feca7bf2060 (patch)
treecc9cd1aedcafa2a4fa5b1f376d39c53be7204629 /libavformat/mpegts.c
parent8897b5aa4c09906e4d43157fdcd7042f47fe15cf (diff)
mpegts: check that codec is not open in mpegts_find_stream_type
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mpegts.c')
-rw-r--r--libavformat/mpegts.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 7380a807fd..aa7bde5768 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -598,6 +598,11 @@ static const StreamType DESC_types[] = {
static void mpegts_find_stream_type(AVStream *st,
uint32_t stream_type, const StreamType *types)
{
+ if (avcodec_is_open(st->codec)) {
+ av_log(NULL, AV_LOG_DEBUG, "cannot set stream info, codec is open\n");
+ return;
+ }
+
for (; types->stream_type; types++) {
if (stream_type == types->stream_type) {
st->codec->codec_type = types->codec_type;