[FFmpeg-devel] Make ffmpeg.c and ffplay.c use avctx->request_channels

Michael Niedermayer michaelni
Fri Dec 14 11:13:32 CET 2007


On Fri, Dec 14, 2007 at 10:10:07AM +0100, Andreas ?man wrote:
> Hello,
>
> Michael Niedermayer wrote:
>> it is just advisory (=many codecs ignore it currently)
>> codecs which fail hard due to request_chan could be changed ...
>
> Here are four patches.
>
> I believe they should be applied at the same time (not in the same
> commit though).
>
> I've fixed the dca.c and ac3dec.c to interpret reqeust_channels
> in a advisory way.
>
> ffmpeg.c now sets up the resampler after the first frame is decoded.
>
> and the changes to ffplay.c is pretty straight forward.
> I have not been able to make SDL work with more than two channels.
> Also, the man-page says that only mono and stereo is supported.
>
> So, If each maintainer can have a look at these please :)

[...]

> Index: ffplay.c
> ===================================================================
> --- ffplay.c	(revision 11202)
> +++ ffplay.c	(working copy)
> @@ -1695,10 +1695,12 @@
>      if (enc->codec_type == CODEC_TYPE_AUDIO) {
>          wanted_spec.freq = enc->sample_rate;
>          wanted_spec.format = AUDIO_S16SYS;
> -        /* hack for AC3. XXX: suppress that */
> -        if (enc->channels > 2)
> -            enc->channels = 2;
> -        wanted_spec.channels = enc->channels;
> +        if(enc->channels > 2) {
> +            wanted_spec.channels = 2;
> +            enc->request_channels = 2;
> +        } else {
> +            wanted_spec.channels = enc->channels;
> +        }
>          wanted_spec.silence = 0;
>          wanted_spec.samples = SDL_AUDIO_BUFFER_SIZE;
>          wanted_spec.callback = sdl_audio_callback;

ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Thouse who are best at talking, realize last or never when they are wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071214/754b22ff/attachment.pgp>



More information about the ffmpeg-devel mailing list