Revision 5d6e4c16 libavcodec/resample.c

View differences:

libavcodec/resample.c
47 47
    /* channel convert */
48 48
    int input_channels, output_channels, filter_channels;
49 49
    AVAudioConvert *convert_ctx[2];
50
    enum SampleFormat sample_fmt[2]; ///< input and output sample format
50
    enum AVSampleFormat sample_fmt[2]; ///< input and output sample format
51 51
    unsigned sample_size[2];         ///< size of one sample in sample_fmt
52 52
    short *buffer[2];                ///< buffers used for conversion to S16
53 53
    unsigned buffer_size[2];         ///< sizes of allocated buffers
......
144 144

  
145 145
ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
146 146
                                        int output_rate, int input_rate,
147
                                        enum SampleFormat sample_fmt_out,
148
                                        enum SampleFormat sample_fmt_in,
147
                                        enum AVSampleFormat sample_fmt_out,
148
                                        enum AVSampleFormat sample_fmt_in,
149 149
                                        int filter_length, int log2_phase_count,
150 150
                                        int linear, double cutoff)
151 151
{
......
178 178
    s->sample_size[0] = av_get_bits_per_sample_fmt(s->sample_fmt[0])>>3;
179 179
    s->sample_size[1] = av_get_bits_per_sample_fmt(s->sample_fmt[1])>>3;
180 180

  
181
    if (s->sample_fmt[0] != SAMPLE_FMT_S16) {
182
        if (!(s->convert_ctx[0] = av_audio_convert_alloc(SAMPLE_FMT_S16, 1,
181
    if (s->sample_fmt[0] != AV_SAMPLE_FMT_S16) {
182
        if (!(s->convert_ctx[0] = av_audio_convert_alloc(AV_SAMPLE_FMT_S16, 1,
183 183
                                                         s->sample_fmt[0], 1, NULL, 0))) {
184 184
            av_log(s, AV_LOG_ERROR,
185 185
                   "Cannot convert %s sample format to s16 sample format\n",
......
189 189
        }
190 190
    }
191 191

  
192
    if (s->sample_fmt[1] != SAMPLE_FMT_S16) {
192
    if (s->sample_fmt[1] != AV_SAMPLE_FMT_S16) {
193 193
        if (!(s->convert_ctx[1] = av_audio_convert_alloc(s->sample_fmt[1], 1,
194
                                                         SAMPLE_FMT_S16, 1, NULL, 0))) {
194
                                                         AV_SAMPLE_FMT_S16, 1, NULL, 0))) {
195 195
            av_log(s, AV_LOG_ERROR,
196 196
                   "Cannot convert s16 sample format to %s sample format\n",
197 197
                   av_get_sample_fmt_name(s->sample_fmt[1]));
......
224 224
{
225 225
    return av_audio_resample_init(output_channels, input_channels,
226 226
                                  output_rate, input_rate,
227
                                  SAMPLE_FMT_S16, SAMPLE_FMT_S16,
227
                                  AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16,
228 228
                                  TAPS, 10, 0, 0.8);
229 229
}
230 230
#endif
......
246 246
        return nb_samples;
247 247
    }
248 248

  
249
    if (s->sample_fmt[0] != SAMPLE_FMT_S16) {
249
    if (s->sample_fmt[0] != AV_SAMPLE_FMT_S16) {
250 250
        int istride[1] = { s->sample_size[0] };
251 251
        int ostride[1] = { 2 };
252 252
        const void *ibuf[1] = { input };
......
276 276

  
277 277
    lenout= 4*nb_samples * s->ratio + 16;
278 278

  
279
    if (s->sample_fmt[1] != SAMPLE_FMT_S16) {
279
    if (s->sample_fmt[1] != AV_SAMPLE_FMT_S16) {
280 280
        output_bak = output;
281 281

  
282 282
        if (!s->buffer_size[1] || s->buffer_size[1] < lenout) {
......
341 341
        ac3_5p1_mux(output, buftmp3[0], buftmp3[1], nb_samples1);
342 342
    }
343 343

  
344
    if (s->sample_fmt[1] != SAMPLE_FMT_S16) {
344
    if (s->sample_fmt[1] != AV_SAMPLE_FMT_S16) {
345 345
        int istride[1] = { 2 };
346 346
        int ostride[1] = { s->sample_size[1] };
347 347
        const void *ibuf[1] = { output };

Also available in: Unified diff