From: Burkhard P. <bur...@ig...> - 2015-03-05 14:59:15
|
Hi, Am 04.03.2015 um 18:13 schrieb Steven Schultz: > Hi — > > It appears that qtinfo’s multichannel audio handing is simplistic and isn’t looking in the correct place for information. > > A 4 channel audio file (produced with Quicktime Player) produces this output from qtinfo: > [...] > Ah ha - so the quicktime file is correct and qtinfo is wrong. You are the first who reports about a wrongly labeled file more 8 years after I programmed that, so it can't be that bad :) > Seems that qtinfo uses the multichannel.c module rather than the quicktime_chan_dump logic of chan.c. The problem is that chan.c defines an insane number of channel labels. So I decided to simplify things a bit and define the LQT_CHANNEL_* enum, which is defined according to real-life files and codecs like AC3, DTS or AAC. > is there a reason multichannel.c is around instead of using the logic in chan.c? The channel locations (as shown by qtinfo) are *always* taken from the chan atom (shown by qtinfo), if that exists. The mapping from chan atom channels to LQT channels happens in chan.c: static struct { lqt_channel_t lqt_channel; channel_label_t channel_label; } lqt_channels[] = { { LQT_CHANNEL_UNKNOWN, CHANNEL_LABEL_Unknown }, { LQT_CHANNEL_FRONT_LEFT, CHANNEL_LABEL_Left }, { LQT_CHANNEL_FRONT_RIGHT, CHANNEL_LABEL_Right }, { LQT_CHANNEL_FRONT_CENTER, CHANNEL_LABEL_Center }, { LQT_CHANNEL_FRONT_CENTER_LEFT, CHANNEL_LABEL_LeftCenter }, { LQT_CHANNEL_FRONT_CENTER_RIGHT, CHANNEL_LABEL_RightCenter }, { LQT_CHANNEL_BACK_CENTER, CHANNEL_LABEL_CenterSurround }, { LQT_CHANNEL_BACK_LEFT, CHANNEL_LABEL_LeftSurround }, { LQT_CHANNEL_BACK_RIGHT, CHANNEL_LABEL_RightSurround }, { LQT_CHANNEL_SIDE_LEFT, CHANNEL_LABEL_LeftSurroundDirect }, { LQT_CHANNEL_SIDE_RIGHT, CHANNEL_LABEL_RightSurroundDirect }, { LQT_CHANNEL_LFE, CHANNEL_LABEL_LFEScreen }, }; Channels 3 and 4 of your file have the fields CHANNEL_LABEL_RearSurroundLeft CHANNEL_LABEL_RearSurroundRight for which no LQT_* equivalent exists. So they are labeled as "Unknown" by qtinfo. Maybe the most pragmatic solution would be to map CHANNEL_LABEL_RearSurroundLeft and CHANNEL_LABEL_RearSurroundRight to LQT_CHANNEL_BACK_LEFT and LQT_CHANNEL_BACK_RIGHT respectively. Another possibility would be to make the chan atom visible in the public API, but I don't know it it worth the effort. The defitions are so messy and redundant that it's better to keep them private. Burkhard |