[codec,h264] reset h264 instance

when resetting the context reinitialize the h264 encoder. this allows
switching the backend
This commit is contained in:
akallabeth
2025-01-12 09:16:57 +01:00
parent 3fcab5f16a
commit 5b77fa3487

View File

@@ -659,11 +659,6 @@ static BOOL h264_context_init(H264_CONTEXT* h264)
if (!h264)
return FALSE;
h264->log = WLog_Get(TAG);
if (!h264->log)
return FALSE;
h264->subsystem = NULL;
InitOnceExecuteOnce(&subsystems_once, h264_register_subsystems, NULL, NULL);
@@ -691,6 +686,12 @@ BOOL h264_context_reset(H264_CONTEXT* h264, UINT32 width, UINT32 height)
h264->width = width;
h264->height = height;
if (h264->subsystem && h264->subsystem->Uninit)
h264->subsystem->Uninit(h264);
if (!h264_context_init(h264))
return FALSE;
return yuv_context_reset(h264->yuv, width, height);
}
@@ -700,6 +701,11 @@ H264_CONTEXT* h264_context_new(BOOL Compressor)
if (!h264)
return NULL;
h264->log = WLog_Get(TAG);
if (!h264->log)
goto fail;
h264->Compressor = Compressor;
if (Compressor)