Ticket #230 (closed defect: fixed)

Opened 3 years ago

Last modified 4 months ago

Multichannel output doesn't work with formats other than 5.0/5.1

Reported by: dconrad Owned by:
Priority: normal Milestone:
Component: Perian-Main Version:
Severity: normal Keywords:
Cc:

Description

The only multichannel formats that ProcessFloats/Process?16BitSignedInts/Process32BitSignedInts interleave correctly are 5.0 and 5.1. This means that 3.1 and 4.0 formats can't be played when the preference for multichannel output is set. Two examples of such audio are  http://samples.mplayerhq.hu/A-codecs/AC3-samples/3.1-buggy/amelie-ac3-3f%2blfe.avi and  http://umbc.edu/~dconrad1/Byousoku_5cm.mov

Attached are a series of patches to simplify and generalize the sample interleaving code to handle these files.

Attachments

0001-Use-a-single-templated-function-to-interleave-and-co.patch Download (14.8 KB) - added by dconrad 3 years ago.
Use a single templated function to interleave and convert samples
0002-Move-getting-the-channel-count-to-its-own-function.patch Download (5.9 KB) - added by dconrad 3 years ago.
Move getting the channel count to its own function
0003-Simplify-and-generalize-interleaving-channels.patch Download (4.1 KB) - added by dconrad 3 years ago.
Simplify and generalize interleaving channels
0004-Don-t-set-a52_flags-based-on-number-of-channels-we.patch Download (1.5 KB) - added by dconrad 3 years ago.
Don't set a52_flags based on number of channels; we can handle whatever the stream is

Change History

Changed 3 years ago by dconrad

Use a single templated function to interleave and convert samples

Changed 3 years ago by dconrad

Move getting the channel count to its own function

Changed 3 years ago by dconrad

Simplify and generalize interleaving channels

Changed 3 years ago by dconrad

Don't set a52_flags based on number of channels; we can handle whatever the stream is

Changed 3 years ago by gbooker

  • status changed from new to closed
  • resolution set to fixed

Comments: 0001: Changed comment about float cast to SInt32 because this is standard procedure documented in liba52's docs. It avoids the whole using FP registers to convert to ints. The integers are signed, not unsigned! See the value of kIntPCMOutFormatFlag

0002: Cleaned up the function (yeah, it was this way originally, but it wasn't my code).

0003: Channel mapping can be done in a more elegant way. Init the map to {0, 1, 2, 3, 4, 5} and the rear channels are always correct. Then, just need to layout the front and LFE channels.

0004: Need to check for mono as well. Also, the channel count *must* match, so check for that.

Committed in changeset 60

Note: See TracTickets for help on using tickets.