diff mbox series

[FFmpeg-devel,2/3] avcodec/aacsbr: Fix type mismatch

Message ID GV1P250MB07373005DFE8FD804013B1928F1C2@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 44474dd7b9e1d2ac842935fc139d9e8517c53002
Headers show
Series [FFmpeg-devel,1/3] avcodec/aactab: Provide ff_ltp_coef, ff_tns_tmp2_map unconditionally | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt May 6, 2024, 9:30 a.m. UTC
ff_aac_sbr_apply() and ff_aac_sbr_apply_fixed() still used
pointers to INTFLOAT which is float or int depending upon
whether USE_FIXED is set or not; in particular, according
to these declarations both functions have the same type.
But that is wrong and given that aacdec.c sets USE_FIXED,
it sees the wrong type for ff_aac_sbr_apply().
Fix this by avoiding INTFLOAT in aacsbr.h (which also means
that aac_defines.h need not be included there any more).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/aac/aacdec.c | 1 +
 libavcodec/aacsbr.h     | 5 ++---
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Lynne May 6, 2024, 5:54 p.m. UTC | #1
May 6, 2024, 11:31 by andreas.rheinhardt@outlook.com:

> ff_aac_sbr_apply() and ff_aac_sbr_apply_fixed() still used
> pointers to INTFLOAT which is float or int depending upon
> whether USE_FIXED is set or not; in particular, according
> to these declarations both functions have the same type.
> But that is wrong and given that aacdec.c sets USE_FIXED,
> it sees the wrong type for ff_aac_sbr_apply().
> Fix this by avoiding INTFLOAT in aacsbr.h (which also means
> that aac_defines.h need not be included there any more).
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/aac/aacdec.c | 1 +
>  libavcodec/aacsbr.h     | 5 ++---
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/libavcodec/aac/aacdec.c b/libavcodec/aac/aacdec.c
> index 72f2d7e7ba..c6b93e33a2 100644
> --- a/libavcodec/aac/aacdec.c
> +++ b/libavcodec/aac/aacdec.c
> @@ -42,6 +42,7 @@
>  #include "aacdec_tab.h"
>  
>  #include "libavcodec/aac.h"
> +#include "libavcodec/aac_defines.h"
>  #include "libavcodec/aacsbr.h"
>  #include "libavcodec/aactab.h"
>  #include "libavcodec/adts_header.h"
> diff --git a/libavcodec/aacsbr.h b/libavcodec/aacsbr.h
> index cd030aa801..656ef5258e 100644
> --- a/libavcodec/aacsbr.h
> +++ b/libavcodec/aacsbr.h
> @@ -31,7 +31,6 @@
>  
>  #include "get_bits.h"
>  #include "aac/aacdec.h"
> -#include "aac_defines.h"
>  
>  #include "libavutil/attributes_internal.h"
>  
> @@ -91,9 +90,9 @@ int ff_aac_sbr_decode_extension_fixed(AACDecContext *ac, ChannelElement *che,
>  
>  /** Apply one SBR element to one AAC element. */
>  void ff_aac_sbr_apply(AACDecContext *ac, ChannelElement *che,
> -                      int id_aac, INTFLOAT* L, INTFLOAT* R);
> +                      int id_aac, float *L, float *R);
>  void ff_aac_sbr_apply_fixed(AACDecContext *ac, ChannelElement *che,
> -                            int id_aac, INTFLOAT* L, INTFLOAT* R);
> +                            int id_aac, int *L, int *R); 
>

Patch 1 and 2 look good to me
diff mbox series

Patch

diff --git a/libavcodec/aac/aacdec.c b/libavcodec/aac/aacdec.c
index 72f2d7e7ba..c6b93e33a2 100644
--- a/libavcodec/aac/aacdec.c
+++ b/libavcodec/aac/aacdec.c
@@ -42,6 +42,7 @@ 
 #include "aacdec_tab.h"
 
 #include "libavcodec/aac.h"
+#include "libavcodec/aac_defines.h"
 #include "libavcodec/aacsbr.h"
 #include "libavcodec/aactab.h"
 #include "libavcodec/adts_header.h"
diff --git a/libavcodec/aacsbr.h b/libavcodec/aacsbr.h
index cd030aa801..656ef5258e 100644
--- a/libavcodec/aacsbr.h
+++ b/libavcodec/aacsbr.h
@@ -31,7 +31,6 @@ 
 
 #include "get_bits.h"
 #include "aac/aacdec.h"
-#include "aac_defines.h"
 
 #include "libavutil/attributes_internal.h"
 
@@ -91,9 +90,9 @@  int ff_aac_sbr_decode_extension_fixed(AACDecContext *ac, ChannelElement *che,
 
 /** Apply one SBR element to one AAC element. */
 void ff_aac_sbr_apply(AACDecContext *ac, ChannelElement *che,
-                      int id_aac, INTFLOAT* L, INTFLOAT* R);
+                      int id_aac, float *L, float *R);
 void ff_aac_sbr_apply_fixed(AACDecContext *ac, ChannelElement *che,
-                            int id_aac, INTFLOAT* L, INTFLOAT* R);
+                            int id_aac, int *L, int *R);
 
 FF_VISIBILITY_POP_HIDDEN