Skip to content

Commit

Permalink
Should MythTV's own mpegts demuxer fail to open the file, try using F…
Browse files Browse the repository at this point in the history
…FMpeg's original one

It's no nice fix and we should really fix it in our own's demuxer; however decision has been made to port our changes upward and start working on using FFmpeg's one

Fixes #11692
  • Loading branch information
jyavenard committed Jul 16, 2013
1 parent 6e08b85 commit 451b4f4
Showing 1 changed file with 29 additions and 11 deletions.
40 changes: 29 additions & 11 deletions mythtv/libs/libmythtv/avformatdecoder.cpp
Expand Up @@ -969,20 +969,38 @@ int AvFormatDecoder::OpenFile(RingBuffer *rbuffer, bool novideo,
return -1;
}

#if 0
fmt->flags |= AVFMT_NOFILE;
#endif

ic = avformat_alloc_context();
if (!ic)
int err;
while (true)
{
LOG(VB_GENERAL, LOG_ERR, LOC + "Could not allocate format context.");
return -1;
}
ic = avformat_alloc_context();
if (!ic)
{
LOG(VB_GENERAL, LOG_ERR, LOC + "Could not allocate format context.");
return -1;
}

InitByteContext();
InitByteContext();

int err = avformat_open_input(&ic, filename, fmt, NULL);
err = avformat_open_input(&ic, filename, fmt, NULL);
if (err < 0)
{
if (!strcmp(fmt->name, "mpegts"))
{
fmt = av_find_input_format("mpegts-ffmpeg");
if (fmt)
{
LOG(VB_GENERAL, LOG_ERR, LOC +
QString("avformat_open_input failed with '%1' error.").arg(err));
LOG(VB_GENERAL, LOG_ERR, LOC +
QString("Attempting using original FFmpeg MPEG-TS demuxer."));
// ic would have been freed due to the earlier failure
continue;
}
break;
}
}
break;
}
if (err < 0)
{
LOG(VB_GENERAL, LOG_ERR, LOC +
Expand Down

0 comments on commit 451b4f4

Please sign in to comment.