Skip to content

Commit

Permalink
encvt: pass the first in chapter too, fix a regression introduced wit…
Browse files Browse the repository at this point in the history
…h the workaround for macOS Sonoma system freeze bug.
  • Loading branch information
galad87 committed Feb 8, 2024
1 parent cf1dc1a commit 633c452
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions libhb/platform/macosx/encvt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1855,16 +1855,19 @@ static hb_buffer_t *vt_encode(hb_work_object_t *w, hb_buffer_t *in)
else
{
CFDictionaryRef frameProperties = NULL;
// macOS Sonoma has got an unfixed bug that makes the whole
// system crash and restart on M* Ultra if we force a keyframe
// on the first frame. So avoid that.
if (in->s.new_chap && job->chapter_markers && pv->frameno_in)
if (in->s.new_chap && job->chapter_markers)
{
// chapters have to start with an IDR frame
const void *keys[1] = { kVTEncodeFrameOptionKey_ForceKeyFrame };
const void *values[1] = { kCFBooleanTrue };
// macOS Sonoma has got an unfixed bug that makes the whole
// system crash and restart on M* Ultra if we force a keyframe
// on the first frame. So avoid that.
if (pv->frameno_in)
{
// chapters have to start with an IDR frame
const void *keys[1] = { kVTEncodeFrameOptionKey_ForceKeyFrame };
const void *values[1] = { kCFBooleanTrue };

frameProperties = CFDictionaryCreate(NULL, keys, values, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
frameProperties = CFDictionaryCreate(NULL, keys, values, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
}

hb_chapter_enqueue(pv->chapter_queue, in);
}
Expand Down

0 comments on commit 633c452

Please sign in to comment.