libobs: Use nal_ref_idc for H.264 priority

H.264 spec only mentions zero/non-zero, but RFC 6184 uses 0/1/2/3 values
for prioritization. Go back to reading packet field for priority.
master
jpark37 2022-08-17 01:11:03 -07:00 committed by Jim
parent 591ba518dc
commit 6494d46111
1 changed files with 5 additions and 9 deletions

View File

@ -55,16 +55,12 @@ static int compute_avc_keyframe_priority(const uint8_t *nal_start,
bool *is_keyframe, int priority)
{
const int type = nal_start[0] & 0x1F;
switch (type) {
case OBS_NAL_SLICE:
if (priority < OBS_NAL_PRIORITY_HIGH)
priority = OBS_NAL_PRIORITY_HIGH;
break;
case OBS_NAL_SLICE_IDR:
if (type == OBS_NAL_SLICE_IDR)
*is_keyframe = true;
priority = OBS_NAL_PRIORITY_HIGHEST;
}
const int new_priority = nal_start[0] >> 5;
if (priority < new_priority)
priority = new_priority;
return priority;
}