Changeset 65e1ec6 for src/io


Ignore:
Timestamp:
Dec 20, 2018, 11:31:23 PM (6 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/crepe, fix/ffmpeg5, master
Children:
5fc6e81
Parents:
f56f795 (diff), cf4bc9f (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.
Message:

Merge branch 'feature/sink_flac' into feature/autosink

Location:
src/io
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/io/sink_flac.c

    rf56f795 r65e1ec6  
    2929#ifdef HAVE_FLAC
    3030
     31#include "fmat.h"
    3132#include "io/ioutils.h"
    32 #include "fmat.h"
    3333
    3434#include <FLAC/metadata.h>
  • src/io/sink_vorbis.c

    rf56f795 r65e1ec6  
    2929#ifdef HAVE_VORBISENC
    3030
     31#include "fmat.h"
    3132#include "io/ioutils.h"
    32 #include "fmat.h"
    3333
    3434#include <vorbis/vorbisenc.h>
  • src/io/source_avcodec.c

    rf56f795 r65e1ec6  
    526526  uint_t end = 0;
    527527  uint_t total_wrote = 0;
    528   uint_t length = aubio_source_validate_input_length("source_wavread", s->path,
     528  uint_t length = aubio_source_validate_input_length("source_avcodec", s->path,
    529529      s->hop_size, read_data->length);
    530   uint_t channels = aubio_source_validate_input_channels("source_wavread",
     530  uint_t channels = aubio_source_validate_input_channels("source_avcodec",
    531531      s->path, s->input_channels, read_data->height);
    532532  while (total_wrote < length) {
  • src/io/source_sndfile.c

    rf56f795 r65e1ec6  
    174174      s->hop_size, read_data->length);
    175175  sf_count_t read_samples = aubio_sf_read_smpl (s->handle, s->scratch_data,
    176       s->input_channels * length);
    177 
    178   length = MIN(read_samples / s->input_channels, length);
     176      s->scratch_size);
     177
     178  uint_t read_length = read_samples / s->input_channels;
    179179
    180180  /* where to store de-interleaved data */
     
    186186#endif /* HAVE_SAMPLERATE */
    187187  {
     188    read_length = MIN(length, read_length);
    188189    ptr_data = read_data->data;
    189190  }
    190191
    191192  /* de-interleaving and down-mixing data  */
    192   for (j = 0; j < length; j++) {
     193  for (j = 0; j < read_length; j++) {
    193194    ptr_data[j] = 0;
    194195    for (i = 0; i < input_channels; i++) {
     
    204205#endif /* HAVE_SAMPLERATE */
    205206
    206   *read = (int)FLOOR(s->ratio * length + .5);
     207  *read = MIN(length, (uint_t)FLOOR(s->ratio * read_length + .5));
    207208
    208209  aubio_source_pad_output (read_data, *read);
     
    218219      s->path, s->input_channels, read_data->height);
    219220  sf_count_t read_samples = aubio_sf_read_smpl (s->handle, s->scratch_data,
    220       length * s->input_channels);
    221 
    222   length = MIN(read_samples / s->input_channels, length);
     221      s->scratch_size);
     222
     223  uint_t read_length = read_samples / s->input_channels;
    223224
    224225  /* where to store de-interleaved data */
     
    230231#endif /* HAVE_SAMPLERATE */
    231232  {
     233    read_length = MIN(read_length, length);
    232234    ptr_data = read_data->data;
    233235  }
    234236
    235   for (j = 0; j < length; j++) {
     237  for (j = 0; j < read_length; j++) {
    236238    for (i = 0; i < channels; i++) {
    237239      ptr_data[i][j] = s->scratch_data[j * input_channels + i];
     
    252254#endif /* HAVE_SAMPLERATE */
    253255
    254   *read = (int)FLOOR(s->ratio * length + .5);
     256  *read = MIN(length, (uint_t)FLOOR(s->ratio * read_length + .5));
    255257
    256258  aubio_source_pad_multi_output(read_data, input_channels, *read);
Note: See TracChangeset for help on using the changeset viewer.