Permalink
Browse files

If AV codec context doesn't match the context for which it was first …

…opened, close/re-open it.

There's something suspiciously wrong about the way we handle change of streams. This is at best a work-around.

Fixes #11519
  • Loading branch information...
jyavenard committed May 12, 2013
1 parent 15ca135 commit 40db16fc3b486042469df8e84290e5d42fc6036f
Showing with 9 additions and 0 deletions.
  1. +9 −0 mythtv/libs/libmythtv/avformatdecoder.cpp
@@ -1978,6 +1978,15 @@ int AvFormatDecoder::ScanStreams(bool novideo)
continue;
}
if (enc->codec && enc->codec->id != enc->codec_id)
{
LOG(VB_PLAYBACK, LOG_INFO, LOC +
QString("Already opened codec not matching (%1 vs %2). Reopening")
.arg(ff_codec_id_string(enc->codec_id))
.arg(ff_codec_id_string(enc->codec->id)));
avcodec_close(enc);
}
if (!enc->codec)
{
if (OpenAVCodec(enc, codec) < 0)

0 comments on commit 40db16f

Please sign in to comment.