shithub: aubio

Download patch

ref: de23e5883fcfadd6aaca4cd1afb92406fbd24323
parent: 50f39f5940cd6df6d651def78df1ee559d27c229
author: Paul Brossier <piem@piem.org>
date: Mon Apr 10 10:53:00 EDT 2017

src/io/source_avcodec.c: more fixes to declare before assigning

--- a/src/io/source_avcodec.c
+++ b/src/io/source_avcodec.c
@@ -113,6 +113,9 @@
   AVCodecContext *avCodecCtx = s->avCodecCtx;
   AVCodec *codec;
   AVFrame *avFrame = s->avFrame;
+#if FF_API_LAVF_AVCTX
+  AVCodecParameters *codecpar;
+#endif
   uint_t i;
   sint_t selected_stream = -1;
   int err;
@@ -194,7 +197,7 @@
   s->selected_stream = selected_stream;
 
 #if FF_API_LAVF_AVCTX
-  AVCodecParameters *codecpar = avFormatCtx->streams[selected_stream]->codecpar;
+  codecpar = avFormatCtx->streams[selected_stream]->codecpar;
   if (codecpar == NULL) {
     AUBIO_ERR("source_avcodec: Could not find decoder for %s", s->path);
     goto beach;
@@ -210,7 +213,7 @@
   }
 #else
   avCodecCtx = avFormatCtx->streams[selected_stream]->codec;
-  AVCodec *codec = avcodec_find_decoder(avCodecCtx->codec_id);
+  codec = avcodec_find_decoder(avCodecCtx->codec_id);
 #endif
   if (codec == NULL) {
     AUBIO_ERR("source_avcodec: Could not find decoder for %s", s->path);