On 12/18/2012 01:15 PM, Anton Khirnov wrote:
> 
> On Sun, 16 Dec 2012 16:27:29 -0500, Justin Ruggles <justin.rugg...@gmail.com> 
> wrote:
[...]
>> +
>> +    if (c->method == AV_RESAMPLE_DITHER_TRIANGULAR_NS) {
>> +        if (sample_rate == 48000) {
>> +            c->ns_coef_b = ns_48_coef_b;
>> +            c->ns_coef_a = ns_48_coef_a;
>> +        } else {
>> +            c->ns_coef_b = ns_44_coef_b;
>> +            c->ns_coef_a = ns_44_coef_a;
>> +        }
>> +    }
>> +
>> +    c->flt_data = ff_audio_data_alloc(channels, 1024, AV_SAMPLE_FMT_FLTP,
>> +                                      "dither flt buffer");
>> +    if (!c->flt_data)
>> +        goto fail;
>> +
>> +    /* Either s16 or s16p output format is allowed, but s16p is used
>> +       internally, so we need to use a temp buffer and interleave if the 
>> output
>> +       format is s16 */
>> +    if (out_fmt != AV_SAMPLE_FMT_S16P) {
>> +        c->s16_data = ff_audio_data_alloc(channels, 1024, 
>> AV_SAMPLE_FMT_S16P,
>> +                                          "dither s16 buffer");
>> +        if (!c->s16_data)
>> +            goto fail;
> 
> Why are you allocating s16_data conditionally and flt_data always.
> flt_data is only used when input format is packed, right?

Only when the input is not FLTP. I just forgot to change that since the
previous patch which sometimes copied the input in order to modify it.
I'll fix that, plus the other 2 things you mentioned.

Thanks,
Justin
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to