shithub: aubio

Download patch

ref: 79dc9adb6a541b1929227ded5d53730686fbc3d6
parent: 724303ec0e581f6060c031c2271dc4552b4b958b
author: Paul Brossier <piem@piem.org>
date: Sun Dec 23 00:44:18 EST 2018

[source_avcodec] show a warning only when an error occurred in swr_convert

--- a/src/io/source_avcodec.c
+++ b/src/io/source_avcodec.c
@@ -463,9 +463,9 @@
       (uint8_t **)&output, max_out_samples,
       (const uint8_t **)avFrame->data, in_samples);
 #endif /* HAVE_AVRESAMPLE || HAVE_SWRESAMPLE */
-  if (out_samples <= 0) {
-    AUBIO_WRN("source_avcodec: no sample found while converting frame (%s)\n",
-        s->path);
+  if (out_samples < 0) {
+    AUBIO_WRN("source_avcodec: error while resampling %s (%d)\n",
+        s->path, out_samples);
     goto beach;
   }