]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Check that the AAC decoder can do fltp decoding. Need to do more of this kind of...
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Sun, 22 May 2022 10:32:36 +0000 (11:32 +0100)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Sun, 22 May 2022 10:32:36 +0000 (11:32 +0100)
rtp.c

diff --git a/rtp.c b/rtp.c
index 8148179f99e747ae0928fa75c4418967d5f1ac00..9baf052b20c89e1b88e7d3be76ffe24932a4a8b6 100644 (file)
--- a/rtp.c
+++ b/rtp.c
@@ -2215,11 +2215,6 @@ void *rtp_buffered_audio_processor(void *arg) {
   // (does nothing if called twice during the course of one program execution)
   // deprecated in ffmpeg 4.0 and later... but still needed in ffmpeg 3.6 / ubuntu 18
 
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-  avcodec_register_all();
-#pragma GCC diagnostic pop
-
   AVCodec *codec = avcodec_find_decoder(AV_CODEC_ID_AAC);
   if (codec == NULL) {
     debug(1, "Can't find an AAC decoder!");
@@ -2244,6 +2239,9 @@ void *rtp_buffered_audio_processor(void *arg) {
   }
   // push a closer -- av_parser_close(codec_parser_context);
   pthread_cleanup_push(av_parser_init_cleanup_handler, codec_parser_context);
+  
+  if (codec_context->sample_fmt != AV_SAMPLE_FMT_FLTP)
+    die("the AAC decoder is not capable of handling Floating Point Planar (\"fltp\") formatted AAC-encoded material.");
 
   AVPacket *pkt = av_packet_alloc();
   if (pkt == NULL) {