]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Check swr_init() error code and exit early. 1897/head
authorAndrew May <acmay_code@acmay.org>
Sat, 17 Aug 2024 06:50:41 +0000 (23:50 -0700)
committerAndrew May <acmay_code@acmay.org>
Sat, 17 Aug 2024 06:50:41 +0000 (23:50 -0700)
rtp.c

diff --git a/rtp.c b/rtp.c
index 93e3fc84c1d3a089ba66cf9c3dd98ef1b1df65da..8a7f0e0ed9259beabfdb6b2e24d55e3736e72127 100644 (file)
--- a/rtp.c
+++ b/rtp.c
@@ -2364,7 +2364,11 @@ void *rtp_buffered_audio_processor(void *arg) {
   };
 
   av_opt_set_sample_fmt(swr, "out_sample_fmt", av_format, 0);
-  swr_init(swr);
+  int swr_err = swr_init(swr);
+  if (swr_err !=0){
+    die("FFMpeg swr_init() failed Error %d (%s)",
+        swr_err, av_err2str(swr_err));
+  }
 
   uint8_t packet[16 * 1024];
   unsigned char m[16 * 1024]; // leave the first 7 bytes blank to make room for the ADTS