Changeset 50f39f5
- Timestamp:
- Apr 10, 2017, 2:35:19 PM (8 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, sampler
- Children:
- de23e58
- Parents:
- 6d8a6403
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/io/source_avcodec.c
r6d8a6403 r50f39f5 110 110 aubio_source_avcodec_t * new_aubio_source_avcodec(const char_t * path, uint_t samplerate, uint_t hop_size) { 111 111 aubio_source_avcodec_t * s = AUBIO_NEW(aubio_source_avcodec_t); 112 AVFormatContext *avFormatCtx = s->avFormatCtx; 113 AVCodecContext *avCodecCtx = s->avCodecCtx; 114 AVCodec *codec; 115 AVFrame *avFrame = s->avFrame; 116 uint_t i; 117 sint_t selected_stream = -1; 112 118 int err; 113 119 if (path == NULL) { … … 139 145 140 146 // try opening the file and get some info about it 141 AVFormatContext *avFormatCtx = s->avFormatCtx;142 147 avFormatCtx = NULL; 143 148 if ( (err = avformat_open_input(&avFormatCtx, s->path, NULL, NULL) ) < 0 ) { … … 168 173 169 174 // look for the first audio stream 170 uint_t i;171 sint_t selected_stream = -1;172 175 for (i = 0; i < avFormatCtx->nb_streams; i++) { 173 176 #if FF_API_LAVF_AVCTX … … 191 194 s->selected_stream = selected_stream; 192 195 193 AVCodecContext *avCodecCtx = s->avCodecCtx;194 196 #if FF_API_LAVF_AVCTX 195 197 AVCodecParameters *codecpar = avFormatCtx->streams[selected_stream]->codecpar; … … 198 200 goto beach; 199 201 } 200 AVCodec *codec = avcodec_find_decoder(codecpar->codec_id);202 codec = avcodec_find_decoder(codecpar->codec_id); 201 203 202 204 /* Allocate a codec context for the decoder */ … … 249 251 } 250 252 251 AVFrame *avFrame = s->avFrame;252 253 avFrame = av_frame_alloc(); 253 254 if (!avFrame) {
Note: See TracChangeset
for help on using the changeset viewer.