[FFmpeg-devel] [PATCH 1/2] avformat/utils: add an internal getter function to access AVStream.attached_pic

James Almer jamrial at gmail.com
Sun Mar 21 21:03:57 EET 2021


On 3/21/2021 2:08 PM, James Almer wrote:
> diff --git a/libavformat/options.c b/libavformat/options.c
> index 07403b533e..bd4056caa1 100644
> --- a/libavformat/options.c
> +++ b/libavformat/options.c
> @@ -220,11 +220,21 @@ AVFormatContext *avformat_alloc_context(void)
>           av_free(ic);
>           return NULL;
>       }
> +#if !FF_API_INIT_PACKET
> +    ic->attached_pic = av_packet_alloc();
> +#endif
>       internal->pkt = av_packet_alloc();
>       internal->parse_pkt = av_packet_alloc();
> -    if (!internal->pkt || !internal->parse_pkt) {
> +    if (!internal->pkt || !internal->parse_pkt
> +#if !FF_API_INIT_PACKET
> +        || !ic->attached_pic
> +#endif
> +    ) {
>           av_packet_free(&internal->pkt);
>           av_packet_free(&internal->parse_pkt);
> +#if !FF_API_INIT_PACKET
> +        av_packet_free(&ic->attached_pic);
> +#endif
>           av_free(internal);
>           av_free(ic);
>           return NULL;

Disregard this patch, since this chunk obviously does not compile. Not 
sure why i didn't notice it.


More information about the ffmpeg-devel mailing list