Quoting Andreas Cadhalpun (2015-08-08 13:37:08)
> They are still widely used and have been deprecated for less than two years.
> 
> Signed-off-by: Andreas Cadhalpun <[email protected]>
> ---
>  libavcodec/avcodec.h | 2 +-
>  libavcodec/utils.c   | 2 +-
>  libavcodec/version.h | 3 +++
>  3 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 4222db6..4202e71 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -3919,7 +3919,7 @@ const AVClass *avcodec_get_subtitle_rect_class(void);
>   */
>  int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
>  
> -#if FF_API_AVFRAME_LAVC
> +#if FF_API_AVCODEC_FRAME
>  /**
>   * @deprecated use av_frame_alloc()
>   */
> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> index 22dcc82..a590782 100644
> --- a/libavcodec/utils.c
> +++ b/libavcodec/utils.c
> @@ -1262,7 +1262,7 @@ int ff_get_format(AVCodecContext *avctx, const enum 
> AVPixelFormat *fmt)
>      return ret;
>  }
>  
> -#if FF_API_AVFRAME_LAVC
> +#if FF_API_AVCODEC_FRAME
>  void avcodec_get_frame_defaults(AVFrame *frame)
>  {
>  #if LIBAVCODEC_VERSION_MAJOR >= 55
> diff --git a/libavcodec/version.h b/libavcodec/version.h
> index 1b37a9e..c903d2f 100644
> --- a/libavcodec/version.h
> +++ b/libavcodec/version.h
> @@ -181,6 +181,9 @@
>  #ifndef FF_API_AUDIOENC_DELAY
>  #define FF_API_AUDIOENC_DELAY    (LIBAVCODEC_VERSION_MAJOR < 58)
>  #endif
> +#ifndef FF_API_AVCODEC_FRAME
> +#define FF_API_AVCODEC_FRAME     (LIBAVCODEC_VERSION_MAJOR < 58)
> +#endif
>  #ifndef FF_API_AVCTX_TIMEBASE
>  #define FF_API_AVCTX_TIMEBASE    (LIBAVCODEC_VERSION_MAJOR < 59)
>  #endif
> -- 
> 2.4.6

This API is dangerous -- it manipulates AVFrame internals from
libavcodec, even though AVFrame now lives in libavutil. It can break
badly if AVFrame is extended in libavutil, but libavcodec is not
updated. I think it also leaks side data, which cannot be fixed while
preserving compatibility.

So I really do not think keeping it is a good idea, especially since
fixing this specific change should be very easy in most cases.

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to