#6551 reported an issue where ExoPlayer was failing to play H264 content because it was passing the 'display resolution' from an HLS manifest to android.media.MediaCodecInfo.VideoCodecCapabilities#areSizeAndRateSupported. In that case the 'display resolution' width was 1129 but the actual samples had a width of 1130. Odd widths are illegal in H264, so the codec reported it couldn't play the content.
The fix (d874656) was to always round video dimensions based on android.media.MediaCodecInfo.VideoCodecCapabilities#getHeightAlignment and getWidthAlignment.
Unfortunately this then caused some confusion in #9103 when a VP8 video with an odd height (405px) failed to decode but the log said format_supported=YES because the height had been rounded to 406px before querying the decoder. Removing the rounding didn't fix the playback error, but it changed the log to say format_supported=NO_EXCEEDS_CAPABILITIES, so it's at least a somewhat 'expected' failure.
Ideally we'd only do the rounding in cases the resolution represents something other than 'sample resolution'. i.e. if it comes from an HLS manifest, we should round. If it comes directly from a media container, we probably shouldn't.
This info probably needs to propagated through Format.
#6551 reported an issue where ExoPlayer was failing to play H264 content because it was passing the 'display resolution' from an HLS manifest to
android.media.MediaCodecInfo.VideoCodecCapabilities#areSizeAndRateSupported. In that case the 'display resolution' width was 1129 but the actual samples had a width of 1130. Odd widths are illegal in H264, so the codec reported it couldn't play the content.The fix (d874656) was to always round video dimensions based on
android.media.MediaCodecInfo.VideoCodecCapabilities#getHeightAlignmentandgetWidthAlignment.Unfortunately this then caused some confusion in #9103 when a VP8 video with an odd height (405px) failed to decode but the log said
format_supported=YESbecause the height had been rounded to 406px before querying the decoder. Removing the rounding didn't fix the playback error, but it changed the log to sayformat_supported=NO_EXCEEDS_CAPABILITIES, so it's at least a somewhat 'expected' failure.Ideally we'd only do the rounding in cases the resolution represents something other than 'sample resolution'. i.e. if it comes from an HLS manifest, we should round. If it comes directly from a media container, we probably shouldn't.
This info probably needs to propagated through
Format.