Improve decoder compatibility by using num_ref_frames=1 when RFI is disabled. Fixes decoder hangs on Amlogic SoCs.

This commit is contained in:
Cameron Gutman 2017-11-30 23:38:49 -08:00
parent deb0e69d64
commit f6ae7fc2b4

View File

@ -324,6 +324,18 @@ static PSDP_OPTION getAttributesList(char*urlSafeAddr) {
err |= addAttributeString(&optionHead, "x-nv-video[0].videoEncoderSlicesPerFrame", payloadStr);
}
if (AppVersionQuad[0] >= 7) {
if (isReferenceFrameInvalidationEnabled()) {
err |= addAttributeString(&optionHead, "x-nv-video[0].maxNumReferenceFrames", "0");
}
else {
// Restrict the video stream to 1 reference frame if we're not using
// reference frame invalidation. This helps to improve compatibility with
// some decoders that don't like the default of having 16 reference frames.
err |= addAttributeString(&optionHead, "x-nv-video[0].maxNumReferenceFrames", "1");
}
}
if (StreamConfig.audioConfiguration == AUDIO_CONFIGURATION_51_SURROUND) {
audioChannelCount = CHANNEL_COUNT_51_SURROUND;
audioChannelMask = CHANNEL_MASK_51_SURROUND;