Changeset 9630fa8


Ignore:
Timestamp:
Dec 20, 2018, 4:45:27 PM (12 months ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink
Children:
d327b6f, e2f1e6d
Parents:
5573a6b
Message:

[sink_flac] check for FLACstream_encoder_process_interleaved success, factorise

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/io/sink_flac.c

    r5573a6b r9630fa8  
    265265}
    266266
     267static void aubio_sink_write_frames(aubio_sink_flac_t *s, uint_t length)
     268{
     269  // send to encoder
     270  if (!FLAC__stream_encoder_process_interleaved(s->encoder,
     271        (const FLAC__int32*)s->buffer, length)) {
     272    FLAC__StreamEncoderState state =
     273      FLAC__stream_encoder_get_state(s->encoder);
     274    AUBIO_WRN("sink_flac: error writing to %s (%s)\n",
     275        s->path, FLAC__StreamEncoderStateString[state]);
     276  }
     277}
     278
    267279void aubio_sink_flac_do(aubio_sink_flac_t *s, fvec_t *write_data,
    268280    uint_t write)
     
    282294  }
    283295  // send to encoder
    284   FLAC__stream_encoder_process_interleaved(s->encoder,
    285       (const FLAC__int32*)s->buffer, length);
     296  aubio_sink_write_frames(s, length);
    286297}
    287298
     
    303314      }
    304315    }
    305     // send to encoder
    306     FLAC__stream_encoder_process_interleaved(s->encoder,
    307         (const FLAC__int32*)s->buffer, length);
    308   }
     316  }
     317  // send to encoder
     318  aubio_sink_write_frames(s, length);
    309319}
    310320
Note: See TracChangeset for help on using the changeset viewer.