fix(macos): fix broken streaming on MacOS (#2485)

This commit is contained in:
Vithorio Polten
2024-05-14 15:14:40 -03:00
committed by GitHub
parent c5d8e1b1a0
commit ff54ab2852
5 changed files with 71 additions and 34 deletions

View File

@@ -909,7 +909,9 @@ namespace video {
},
{}, // SDR-specific options
{}, // HDR-specific options
{}, // Fallback options
{
{ "flags"s, "-low_delay" },
}, // Fallback options
std::nullopt,
"h264_videotoolbox"s,
},
@@ -1451,7 +1453,10 @@ namespace video {
}
}
ctx->flags |= (AV_CODEC_FLAG_CLOSED_GOP | AV_CODEC_FLAG_LOW_DELAY);
// We forcefully reset the flags to avoid clash on reuse of AVCodecContext
ctx->flags = 0;
ctx->flags |= AV_CODEC_FLAG_CLOSED_GOP | AV_CODEC_FLAG_LOW_DELAY;
ctx->flags2 |= AV_CODEC_FLAG2_FAST;
auto avcodec_colorspace = avcodec_colorspace_from_sunshine_colorspace(colorspace);