shithub: aubio

Download patch

ref: 5bd9a2b2931e1ed830d63a3a49b128abff36d8d4
parent: de23e5883fcfadd6aaca4cd1afb92406fbd24323
author: Paul Brossier <piem@piem.org>
date: Mon Apr 10 11:16:44 EDT 2017

src/io/source_avcodec.c: more fixes for declaration before assignment

--- a/src/io/source_avcodec.c
+++ b/src/io/source_avcodec.c
@@ -111,13 +111,13 @@
   aubio_source_avcodec_t * s = AUBIO_NEW(aubio_source_avcodec_t);
   AVFormatContext *avFormatCtx = s->avFormatCtx;
   AVCodecContext *avCodecCtx = s->avCodecCtx;
-  AVCodec *codec;
   AVFrame *avFrame = s->avFrame;
+  sint_t selected_stream = -1;
 #if FF_API_LAVF_AVCTX
   AVCodecParameters *codecpar;
 #endif
+  AVCodec *codec;
   uint_t i;
-  sint_t selected_stream = -1;
   int err;
   if (path == NULL) {
     AUBIO_ERR("source_avcodec: Aborted opening null path\n");
@@ -343,7 +343,6 @@
   AVCodecContext *avCodecCtx = s->avCodecCtx;
   AVFrame *avFrame = s->avFrame;
   AVPacket avPacket = s->avPacket;
-  av_init_packet (&avPacket);
 #ifdef HAVE_AVRESAMPLE
   AVAudioResampleContext *avr = s->avr;
 #elif defined(HAVE_SWRESAMPLE)
@@ -350,6 +349,7 @@
   SwrContext *avr = s->avr;
 #endif /* HAVE_AVRESAMPLE || HAVE_SWRESAMPLE */
   smpl_t *output = s->output;
+  av_init_packet (&avPacket);
   *read_samples = 0;
 
   do