[FFmpeg-devel] [PATCH 07/14] avcodec/vorbis: Use void* logctx instead of AVCodecContext*

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Sat Sep 30 13:28:59 EEST 2023


Andreas Rheinhardt:
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> ---
>  libavcodec/vorbis.c | 8 +++++---
>  libavcodec/vorbis.h | 4 +---
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/libavcodec/vorbis.c b/libavcodec/vorbis.c
> index d0b660b44a..3d85997576 100644
> --- a/libavcodec/vorbis.c
> +++ b/libavcodec/vorbis.c
> @@ -27,8 +27,10 @@
>   */
>  
>  #include "libavutil/common.h"
> +#include "libavutil/error.h"
> +#include "libavutil/log.h"
> +#include "libavutil/macros.h"
>  
> -#include "avcodec.h"
>  #include "vorbis.h"
>  #include "vorbis_data.h"
>  
> @@ -104,7 +106,7 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num)
>      return 0;
>  }
>  
> -int ff_vorbis_ready_floor1_list(AVCodecContext *avctx,
> +int ff_vorbis_ready_floor1_list(void *logctx,
>                                  vorbis_floor1_entry *list, int values)
>  {
>      int i;
> @@ -130,7 +132,7 @@ int ff_vorbis_ready_floor1_list(AVCodecContext *avctx,
>          int j;
>          for (j = i + 1; j < values; j++) {
>              if (list[i].x == list[j].x) {
> -                av_log(avctx, AV_LOG_ERROR,
> +                av_log(logctx, AV_LOG_ERROR,
>                         "Duplicate value found in floor 1 X coordinates\n");
>                  return AVERROR_INVALIDDATA;
>              }
> diff --git a/libavcodec/vorbis.h b/libavcodec/vorbis.h
> index aa1ec5719d..7190465f0d 100644
> --- a/libavcodec/vorbis.h
> +++ b/libavcodec/vorbis.h
> @@ -23,8 +23,6 @@
>  
>  #include <stdint.h>
>  
> -#include "avcodec.h"
> -
>  typedef struct vorbis_floor1_entry {
>      uint16_t x;
>      uint16_t sort;
> @@ -32,7 +30,7 @@ typedef struct vorbis_floor1_entry {
>      uint16_t high;
>  } vorbis_floor1_entry;
>  
> -int ff_vorbis_ready_floor1_list(AVCodecContext *avctx,
> +int ff_vorbis_ready_floor1_list(void *logctx,
>                                  vorbis_floor1_entry *list, int values);
>  unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n); // x^(1/n)
>  int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num);

Will apply patches 7-14 tomorrow unless there are objections.

- Andreas



More information about the ffmpeg-devel mailing list