On Wed, Oct 8, 2014 at 8:32 PM, Anton Khirnov <[email protected]> wrote:
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index f0fa7a9..b6cd74d 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -1170,7 +1170,8 @@ typedef struct AVCodecContext {
>       * timebase should be 1/framerate and timestamp increments should be
>       * identically 1.
>       * - encoding: MUST be set by user.
> -     * - decoding: Set by libavcodec.
> +     * - decoding: the use of this field for decoding is deprecated.
> +     *             Use framerate instead.
>       */
>      AVRational time_base;

You are missing deprecation guards here.

> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> index 80ba858..89f15a9 100644
> --- a/libavcodec/utils.c
> +++ b/libavcodec/utils.c
> @@ -1252,6 +1252,11 @@ int attribute_align_arg avcodec_open2(AVCodecContext 
> *avctx, const AVCodec *code
>              ret = AVERROR(EINVAL);
>              goto free_and_end;
>          }
> +
> +#if FF_API_AVCTX_TIMEBASE
> +        if (avctx->framerate.num > 0 && avctx->framerate.den > 0)
> +            avctx->time_base = av_inv_q(avctx->framerate);
> +#endif
>      }
>  end:
>      entangled_thread_counter--;
> @@ -1660,6 +1665,11 @@ int attribute_align_arg 
> avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
>      } else
>          ret = 0;
>
> +#if FF_API_AVCTX_TIMEBASE
> +    if (avctx->framerate.num > 0 && avctx->framerate.den > 0)
> +        avctx->time_base = av_inv_q(avctx->framerate);
> +#endif
> +
>      return ret;
>  }

And the FF_DISABLE_DEPRECATION_WARNINGS here.

> diff --git a/libavcodec/version.h b/libavcodec/version.h
> index 773d21e..dd55b5f 100644
> --- a/libavcodec/version.h
> +++ b/libavcodec/version.h
> @@ -153,5 +153,9 @@
>  #ifndef FF_API_AFD
>  #define FF_API_AFD               (LIBAVCODEC_VERSION_MAJOR < 57)
>  #endif
> +#ifndef FF_API_AVCTX_TIMEBASE
> +#define FF_API_AVCTX_TIMEBASE    (LIBAVCODEC_VERSION_MAJOR < 58)
> +#endif
> +

59?

Looks fine otherwise.
Vittorio
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to