[FFmpeg-devel] [PATCH] 5.1->stereo resample

Brian Connolly brian
Fri Jan 11 23:53:10 CET 2008

Here is a very simple patch that allows libavcodec/resample.c to convert a 5.1 audio stream to stereo. 

Currently, any attempt to do this is rejected with an error message "Resampling with input channels greater than 2 unsupported."

After applying this patch, the audio_resample routine performs the following logic for 6-channel input streams:

- out-left = front_left + (rear_gain * rear_left) + (center_gain * center)
- out-right = front_right + (rear_gain * rear_right) + (center_gain * center)

...where rear_gain is 0.5 and center_gain is 0.7 (-3 dB).

- Bri
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 6to2channel-resample.patch
Type: application/octet-stream
Size: 2860 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080111/691922d1/attachment.obj>

More information about the ffmpeg-devel mailing list