[FFmpeg-devel] [PATCH] avcodec/audiotoolboxdec: Fix decoding 24 Bit ALAC

2021-05-31 Thread Valerii Zapodovnikov
"avctx->bits_per_raw_sample" always returns 0.
Tested with 24 Bit ALAC. The result is bit-perfect.
Fix #7287.

Co-authored-by: Davis 
---
 libavcodec/audiotoolboxdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/audiotoolboxdec.c b/libavcodec/audiotoolboxdec.c
index cbd381ef12..c7e1760645 100644
--- a/libavcodec/audiotoolboxdec.c
+++ b/libavcodec/audiotoolboxdec.c
@@ -303,7 +303,7 @@ static av_cold int ffat_create_decoder(AVCodecContext 
*avctx,
 OSStatus status;
 int i;
 
-enum AVSampleFormat sample_fmt = (avctx->bits_per_raw_sample == 32) ?
+enum AVSampleFormat sample_fmt = (avctx->bits_per_coded_sample > 16) ?
  AV_SAMPLE_FMT_S32 : AV_SAMPLE_FMT_S16;
 
 AudioStreamBasicDescription in_format = {
-- 
2.30.2

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH] avcodec/audiotoolboxdec: Fix decoding 24 Bit ALAC "avctx->bits_per_raw_sample" always returns 0. Tested with 24 Bit ALAC. The result is bit-perfect. Fix #7287.

2021-05-31 Thread Valerii Zapodovnikov
Co-authored-by: Davis 
---
 libavcodec/audiotoolboxdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/audiotoolboxdec.c b/libavcodec/audiotoolboxdec.c
index cbd381ef12..c7e1760645 100644
--- a/libavcodec/audiotoolboxdec.c
+++ b/libavcodec/audiotoolboxdec.c
@@ -303,7 +303,7 @@ static av_cold int ffat_create_decoder(AVCodecContext 
*avctx,
 OSStatus status;
 int i;
 
-enum AVSampleFormat sample_fmt = (avctx->bits_per_raw_sample == 32) ?
+enum AVSampleFormat sample_fmt = (avctx->bits_per_coded_sample > 16) ?
  AV_SAMPLE_FMT_S32 : AV_SAMPLE_FMT_S16;
 
 AudioStreamBasicDescription in_format = {
-- 
2.30.2

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avcodec/audiotoolboxdec: Fix decoding 24 Bit ALAC

2019-07-09 Thread myp...@gmail.com
On Tue, Jul 9, 2019 at 12:37 AM Davis  wrote:
>
> "avctx->bits_per_raw_sample" always returns 0.
> Tested with 24 Bit ALAC. The result is bit-perfect.
> Fix #7287.
> ---
>  libavcodec/audiotoolboxdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/audiotoolboxdec.c b/libavcodec/audiotoolboxdec.c
> index 5c0a9de8f6..95bf9acc42 100644
> --- a/libavcodec/audiotoolboxdec.c
> +++ b/libavcodec/audiotoolboxdec.c
> @@ -302,7 +302,7 @@ static av_cold int ffat_create_decoder(AVCodecContext 
> *avctx, AVPacket *pkt)
>  OSStatus status;
>  int i;
>
> -enum AVSampleFormat sample_fmt = (avctx->bits_per_raw_sample == 32) ?
> +enum AVSampleFormat sample_fmt = (avctx->bits_per_coded_sample > 16) ?
LGTM
>   AV_SAMPLE_FMT_S32 : AV_SAMPLE_FMT_S16;
>
>  AudioStreamBasicDescription in_format = {
> --
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] avcodec/audiotoolboxdec: Fix decoding 24 Bit ALAC

2019-07-08 Thread Davis
"avctx->bits_per_raw_sample" always returns 0.
Tested with 24 Bit ALAC. The result is bit-perfect.
Fix #7287.
---
 libavcodec/audiotoolboxdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/audiotoolboxdec.c b/libavcodec/audiotoolboxdec.c
index 5c0a9de8f6..95bf9acc42 100644
--- a/libavcodec/audiotoolboxdec.c
+++ b/libavcodec/audiotoolboxdec.c
@@ -302,7 +302,7 @@ static av_cold int ffat_create_decoder(AVCodecContext 
*avctx, AVPacket *pkt)
 OSStatus status;
 int i;
 
-enum AVSampleFormat sample_fmt = (avctx->bits_per_raw_sample == 32) ?
+enum AVSampleFormat sample_fmt = (avctx->bits_per_coded_sample > 16) ?
  AV_SAMPLE_FMT_S32 : AV_SAMPLE_FMT_S16;
 
 AudioStreamBasicDescription in_format = {
-- 
2.20.1 (Apple Git-117)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".