[FFmpeg-devel] [PATCH] DCA - setup correct channel value when downmixing is required

Benjamin Larsson banan
Sun Jul 25 00:18:50 CEST 2010


On 24/07/10 12:52, Nick Brereton wrote:
> On Sat, 2010-07-24 at 11:25 +0200, Benjamin Larsson wrote:
>> On 24/07/10 02:49, FB2000 wrote:
>>> Without this, trying to convert 5.1 DTS sample to 2 channels Wave with
>>> command
>>>
>>> ffmpeg -i sample.dts -ac 2 out.wav
>>>
>>> always failed with error "Resampling with input channels greater than 2
>>> unsupported", because avctx->channels still equals to 6.
>>>
>>>
>>>
>>> Index: dca.c
>>> ===================================================================
>>> --- dca.c       (revision 24472)
>>> +++ dca.c       (working copy)
>>> @@ -1371,6 +1371,7 @@
>>>          if (avctx->request_channels == 2 && s->prim_channels > 2) {
>>>              channels = 2;
>>>              s->output = DCA_STEREO;
>>> +            avctx->channels = 2;
>>>              avctx->channel_layout = CH_LAYOUT_STEREO;
>>>          }
>>>      } else {
>>
>> Patch ok.
>>
> 
> I've attached an alternative patch here. This should work a bit better
> as it will disable further XCh processing and allows selection of 5.1ch
> output when the source material is actually 6.1ch.
> 
> The output from down mixing to 2 channels from 6/7 channel sources is
> also broken (add_bias must be taken account of and the channel mappings
> are wrong in the existing code) - that needs to be fixed in a separate
> patch. Unless someone else has a go at it, I'll fix it later this
> weekend.
> 
> 
>> MvH
>> Benjamin Larsson
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel at mplayerhq.hu
>> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
> 
> Cheers,
> 
> Nick
> 

Patch is ok if it works.

MvH
Benjamin Larsson



More information about the ffmpeg-devel mailing list