Changeset 8a4ccf7


Ignore:
Timestamp:
Nov 16, 2018, 9:12:45 PM (13 months ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master
Children:
ac97e80d
Parents:
ca99325
Message:

[source] [avcodec] downmix signal manually

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/io/source_avcodec.c

    rca99325 r8a4ccf7  
    311311    int err;
    312312    int64_t input_layout = av_get_default_channel_layout(s->input_channels);
    313     uint_t output_channels = multi ? s->input_channels : 1;
    314     int64_t output_layout = av_get_default_channel_layout(output_channels);
     313    int64_t output_layout = av_get_default_channel_layout(s->input_channels);
    315314#ifdef HAVE_AVRESAMPLE
    316315    AVAudioResampleContext *avr = avresample_alloc_context();
     
    504503    end = MIN(s->read_samples - s->read_index, s->hop_size - total_wrote);
    505504    for (i = 0; i < end; i++) {
    506       read_data->data[i + total_wrote] = s->output[i + s->read_index];
     505      read_data->data[i + total_wrote] = 0.;
     506      for (j = 0; j < s->input_channels; j++) {
     507        read_data->data[i + total_wrote] +=
     508          s->output[(i + s->read_index) * s->input_channels + j];
     509      }
     510      read_data->data[i + total_wrote] *= 1./s->input_channels;
    507511    }
    508512    total_wrote += end;
Note: See TracChangeset for help on using the changeset viewer.