From: Paul Brossier Date: Mon, 10 Apr 2017 12:53:00 +0000 (+0200) Subject: src/io/source_avcodec.c: more fixes to declare before assigning X-Git-Tag: 0.4.6~71 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=de23e5883fcfadd6aaca4cd1afb92406fbd24323;p=aubio.git src/io/source_avcodec.c: more fixes to declare before assigning --- diff --git a/src/io/source_avcodec.c b/src/io/source_avcodec.c index 8adb3320..3733803a 100644 --- a/src/io/source_avcodec.c +++ b/src/io/source_avcodec.c @@ -113,6 +113,9 @@ aubio_source_avcodec_t * new_aubio_source_avcodec(const char_t * path, uint_t sa 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 @@ aubio_source_avcodec_t * new_aubio_source_avcodec(const char_t * path, uint_t sa 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 @@ aubio_source_avcodec_t * new_aubio_source_avcodec(const char_t * path, uint_t sa } #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);