[FFmpeg-devel] [PATCH] cbs_h2645: Implement replace-PS with a table rather than many functions

Nuo Mi nuomi2021 at gmail.com
Wed Jan 27 15:52:14 EET 2021


On Wed, Jan 27, 2021 at 7:06 AM Mark Thompson <sw at jkqxz.net> wrote:

>
> +
> +    err = ff_cbs_make_unit_refcounted(ctx, unit);
> +    if (err < 0)
> +        return err;
> +
> +    ref_array =
> +         (AVBufferRef**)((uint8_t*)ctx->priv_data +
> ps_type->ref_array_offset);
> +    ptr_array = (void**)((uint8_t*)ctx->priv_data +
> ps_type->ptr_array_offset);
> +    active    = (void**)((uint8_t*)ctx->priv_data +
> ps_type->active_offset);
> +
> +    if (ptr_array[id] == *active) {
> +        // The old active parameter set is being overwritten, so it can't
> +        // be active after this point.
> +        *active = NULL;
> +    }
> +    av_buffer_unref(&ref_array[id]);
> +
> +    ref_array[id] = av_buffer_ref(unit->content_ref);
> +    if (!ref_array[id])
> +        return AVERROR(ENOMEM);
>
This happend after ff_cbs_make_unit_refcounted, do we need urnef
unit->content_ref
before return?

> +    ptr_array[id] = ref_array[id]->data;
> +
> +    return 0;
> +}
>
>
> 2.29.2
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list