Skip to content
Browse files

Fix VDA playback for some videos.

This fix allows playing BBC videos.
Apple Video Decode Acceleration framework doesn't handle interlaced h264 properly. So add a quick test to check if video is interlaced or not.

While our original VDA code was heavily based on XBMC implementation, it introduced some errors ; there were some minor leaks and some necessary broken h264 encoding workarounds weren't implemented (AVD just hang on those)

Additionally, XBMC has fixed bugs since and the fixes never made it to mythtv.

Tracking what changed where was too time consuming, so shamelessly remove our customisation and re-use XBMC initialisation code as-is.
Additionally, we were using a non-official ffmpeg call (ff_find_start_code) which has been renamed and moved since; so the previous code would have been broken during the next ffmpeg resync.

FFmpeg master now supports VDA decoding, but their code doesn't handle any of the borderline scenarios handled here. Making it pretty much useless for the time being

Fixes #10466
  • Loading branch information
jyavenard committed Mar 16, 2012
1 parent 111f0ed commit 2c08a7d1788b4a8183a70c288be0cec46a3f36d0
@@ -951,6 +951,16 @@ void H264Parser::decode_SPS(GetBitContext * gb)

void H264Parser::parse_SPS(uint8_t *sps, uint32_t sps_size,
bool& interlaced, int32_t& max_ref_frames)
GetBitContext gb;
init_get_bits(&gb, sps, sps_size << 3);
interlaced = !frame_mbs_only_flag;
max_ref_frames = num_ref_frames;

void H264Parser::decode_PPS(GetBitContext * gb)
@@ -164,6 +164,9 @@ class H264Parser {

uint32_t GetUnitsInTick(void) const { return unitsInTick; }

void parse_SPS(uint8_t *sps, uint32_t sps_size,
bool& interlaced, int32_t& max_ref_frames);

enum constants {EXTENDED_SAR = 255};

0 comments on commit 2c08a7d

Please sign in to comment.
You can’t perform that action at this time.