Ignore:
Timestamp:
Jan 26, 2014, 8:19:31 PM (10 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
3cc3fd8
Parents:
a9fd272
Message:

src/io/source*: add _close function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/io/source_avcodec.c

    ra9fd272 r422452b  
    391391}
    392392
    393 void del_aubio_source_avcodec(aubio_source_avcodec_t * s){
    394   if (!s) return;
    395   if (s->output != NULL) {
    396     av_free(s->output);
    397   }
     393uint_t aubio_source_avcodec_close(aubio_source_avcodec_t * s) {
    398394  if (s->avr != NULL) {
    399395    avresample_close( s->avr );
     
    401397  }
    402398  s->avr = NULL;
    403   if (s->avFrame != NULL) {
    404     avcodec_free_frame( &(s->avFrame) );
    405   }
    406   s->avFrame = NULL;
    407399  if (s->avCodecCtx != NULL) {
    408400    avcodec_close ( s->avCodecCtx );
     
    412404    avformat_close_input ( &(s->avFormatCtx) );
    413405  }
     406  s->avFormatCtx = NULL;
     407  return AUBIO_OK;
     408}
     409
     410void del_aubio_source_avcodec(aubio_source_avcodec_t * s){
     411  if (!s) return;
     412  aubio_source_avcodec_close(s);
     413  if (s->output != NULL) {
     414    av_free(s->output);
     415  }
     416  s->output = NULL;
     417  if (s->avFrame != NULL) {
     418    avcodec_free_frame( &(s->avFrame) );
     419  }
    414420  s->avFrame = NULL;
    415   s->avFormatCtx = NULL;
    416421  AUBIO_FREE(s);
    417422}
Note: See TracChangeset for help on using the changeset viewer.