Changeset 1dfe409 for src/io/source_avcodec.c
- Timestamp:
- Mar 31, 2019, 11:12:40 PM (5 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/crepe, fix/ffmpeg5, master
- Children:
- 76b6dd3
- Parents:
- 08246ee (diff), f55630c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/io/source_avcodec.c
r08246ee r1dfe409 31 31 #endif 32 32 #include <libavutil/opt.h> 33 #include <stdlib.h>34 33 35 34 // determine whether we use libavformat from ffmpeg or from libav … … 121 120 uint_t samplerate, uint_t hop_size) { 122 121 aubio_source_avcodec_t * s = AUBIO_NEW(aubio_source_avcodec_t); 123 AVFormatContext *avFormatCtx = s->avFormatCtx;124 AVCodecContext *avCodecCtx = s->avCodecCtx;125 AVFrame *avFrame = s->avFrame;122 AVFormatContext *avFormatCtx = NULL; 123 AVCodecContext *avCodecCtx = NULL; 124 AVFrame *avFrame = NULL; 126 125 sint_t selected_stream = -1; 127 126 #if FF_API_LAVF_AVCTX … … 465 464 (const uint8_t **)avFrame->data, in_samples); 466 465 #endif /* HAVE_AVRESAMPLE || HAVE_SWRESAMPLE */ 467 if (out_samples < =0) {468 AUBIO_WRN("source_avcodec: no sample found while converting frame (%s)\n",469 s->path );466 if (out_samples < 0) { 467 AUBIO_WRN("source_avcodec: error while resampling %s (%d)\n", 468 s->path, out_samples); 470 469 goto beach; 471 470 } … … 474 473 475 474 beach: 476 s->avFormatCtx = avFormatCtx;477 s->avCodecCtx = avCodecCtx;478 s->avFrame = avFrame;479 #if defined(HAVE_AVRESAMPLE) || defined(HAVE_SWRESAMPLE)480 s->avr = avr;481 #endif /* HAVE_AVRESAMPLE || HAVE_SWRESAMPLE */482 s->output = output;483 484 475 av_packet_unref(&avPacket); 485 476 } … … 629 620 #ifdef HAVE_AVRESAMPLE 630 621 avresample_close( s->avr ); 622 av_free ( s->avr ); 631 623 #elif defined(HAVE_SWRESAMPLE) 632 624 swr_close ( s->avr ); 633 #endif 634 av_free ( s->avr ); 625 swr_free ( &s->avr ); 626 #endif 635 627 } 636 628 s->avr = NULL;
Note: See TracChangeset
for help on using the changeset viewer.