Skip to content

Commit

Permalink
fixed potential bug in obu unframer when dec config not ready
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanlf committed Dec 4, 2023
1 parent cdc6d93 commit ad11d0a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/filters/rewrite_obu.c
Expand Up @@ -79,9 +79,12 @@ GF_Err obumx_configure_pid(GF_Filter *filter, GF_FilterPid *pid, Bool is_remove)
return GF_NOT_SUPPORTED;

dcd = gf_filter_pid_get_property(pid, GF_PROP_PID_DECODER_CONFIG);
if (!dcd) return GF_NON_COMPLIANT_BITSTREAM;
//may happen if first frame not yet received by reframer
if (!dcd)
crc = -1;
else
crc = gf_crc_32(dcd->value.data.ptr, dcd->value.data.size);

crc = gf_crc_32(dcd->value.data.ptr, dcd->value.data.size);
if (ctx->crc == crc) return GF_OK;
ctx->crc = crc;

Expand All @@ -95,9 +98,11 @@ GF_Err obumx_configure_pid(GF_Filter *filter, GF_FilterPid *pid, Bool is_remove)

ctx->ipid = pid;
ctx->passthrough = GF_FALSE;
p = gf_filter_pid_get_property_str(pid, "nodata");
p = gf_filter_pid_get_property_str(pid, "nodata");
if (p && p->value.boolean) ctx->passthrough = GF_TRUE;

if (!dcd) return GF_OK;

p = gf_filter_pid_get_property(ctx->ipid, GF_PROP_PID_CODECID);
ctx->codec_id = p ? p->value.uint : 0;
switch (ctx->codec_id) {
Expand Down

0 comments on commit ad11d0a

Please sign in to comment.