Skip to content

Commit

Permalink
Use FFmpeg MPEG-TS demuxer when MythTV demuxer fails
Browse files Browse the repository at this point in the history
The FFmpeg demuxer may fail when there is a change in the streams halfway playback.This can happen
when changing to a commercial and back or when a recording extends through multiple programs
The MythTV demuxer can handle these changes. However, some streams are not correctly handled by the MythTV demuxer.
The code is written such that there is an automatic fallback to the original FFmpeg MPEG-TS demuxer when
the MythTV demuxer fails.
In the refactoring of the code for MythTV release v31, in commit 76bca2a, the fallback code is still present
but is, due to a minor coding mistake, never executed. This is now fixed.
Tested as follows:
BBC Three and BBC Four in the UK are off air until 7:00pm when they start broadcasting.
Recording start at 60 seconds before the start of the first program.
This then creates a recording that cannot be demuxed by the MythTV demuxer but which
can be played back correct whne the FFmpeg demuxer is used.
  • Loading branch information
kmdewaal committed May 15, 2024
1 parent e5dc245 commit 720057c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/decoders/avformatdecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ int AvFormatDecoder::OpenFile(MythMediaBuffer *Buffer, bool novideo,
.arg(av_make_error_stdstring(error, err)));

// note - m_ic (AVFormatContext) is freed on failure
if (retries > 1)
if (retries > 2)
{
// wait a little to buffer more data
// 50*0.1 = 5 seconds max
Expand Down

1 comment on commit 720057c

@Jpilk
Copy link

@Jpilk Jpilk commented on 720057c May 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Klaas: I was interested to see this. Starting a BBC Four 704x576 DVB-T recording at 18:59 has usually worked for me, and I almost always post-process it anyway. Today I tried an 18:58 start with this commit. Playback started black, then audio with an on-screen notice that didn't go away. Restarted playback is fine for about 5 sec, then reverts to the audio+notice. I'm using OpenGL Normal.

Maybe your signal format is different from mine, or our Myth settings differ. I'm sure I shall be able to get playable recordings after some experiment. It's a pity that the channel "isn't what it was".

John

Please sign in to comment.