Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restarting playback with VDPAU after PMT change
Playback of some recordings of the Finnish broadcaster YLE fails when the VDPAU hardware accelerator is selected in the playback profile. This is caused by a restart of the video decoding after a PMT change. This problem only occurs with the MythTV-specific demuxer (mpegts-mythtv.c) and not with the original FFmpeg demuxer (mpegts.c) because the FFmpeg demuxer largely ignores PMT changes once playback has started. The first time the VDPAU codec support is checked, the pixel format is given as AV_PIX_FMT_YUV420P. This pixel format translates to video frame type FMT_YV12. There is a check if the video frame type is FMT_YV12 and this check succeeds. At the end, when it is decided that VDPAU can be used, the pixel format is set to AV_PIX_FMT_VDPAU. After a playback restart following a PMT change the VDPAU codec support is checked again. The AVCodecContext is re-used and the pixel format is still set to AV_PIX_FMT_VDPAU. This pixel format translate to video frame type FMT_VDPAU. The check if the frame type is FMT_YV12 now fails and there is an attempt to continue with FFMPEG decoding. This also fails, then resulting in a black screen while waiting forever. The fix is to accept also video frame type FMT_VDPAU for use with VDPAU decoding. This does solve the playback problems of all available YLE test clips. It can possibly also solve playback problems in other cases where the PMT changes such as when a channel that is broadcasting only part of the day does start broadcasting. Note that in the beginning of MythVDPAUContext::GetSupportedCodec there is a check if frame type FMT_VDPAU is supported and VDPAU can only be used if this is the case. It therefore makes sense to accept FMT_VDPAU as a valid video frame type and it was probably an omission in the original code that this frame type was not accepted. Refs #402
- Loading branch information