[FFmpeg-devel] [PATCH] lavc: add lavfi metadata support. [NEW ATTEMPT]

Nicolas George nicolas.george at normalesup.org
Wed Oct 17 11:39:25 CEST 2012


Le sextidi 26 vendémiaire, an CCXXI, Clément Bœsch a écrit :
> @@ -1572,6 +1595,7 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
>          int did_split = av_packet_split_side_data(&tmp);
>          apply_param_change(avctx, &tmp);
>          avctx->pkt = &tmp;
> +        set_metadata_from_side_data(avctx, picture);
>          if (HAVE_THREADS && avctx->active_thread_type & FF_THREAD_FRAME)
>              ret = ff_thread_decode_frame(avctx, picture, got_picture_ptr,
>                                           &tmp);
> @@ -1588,7 +1612,9 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
>              if (!picture->width)                   picture->width               = avctx->width;
>              if (!picture->height)                  picture->height              = avctx->height;
>              if (picture->format == AV_PIX_FMT_NONE)   picture->format              = avctx->pix_fmt;
> +
>          }
> +        avctx->metadata = picture->metadata;

It looks quite smart, and it seems it will work even with B-frames.

Unfortunately, I am afraid it will leak the dictionary if the codec is
closed while it still has delayed frames that were not flushed.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121017/5fd819e0/attachment.asc>


More information about the ffmpeg-devel mailing list