diff options
author | Alex Converse <alex.converse@gmail.com> | 2012-01-05 05:42:15 +0400 |
---|---|---|
committer | Alex Converse <alex.converse@gmail.com> | 2012-01-05 22:34:06 +0400 |
commit | 4274e481c01e70085597f6980d3f14330528a0f7 (patch) | |
tree | bfd4d08dc95b231287bf6819fae32ac8e3887ccf /libavformat/mov_chan.c | |
parent | 9b55b4bb3acc5f41b00eed5b93af4cd8400c9145 (diff) |
mov: Support MOV_CH_LAYOUT_USE_DESCRIPTIONS for labeled descriptions.
Diffstat (limited to 'libavformat/mov_chan.c')
-rw-r--r-- | libavformat/mov_chan.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c index 3c1ced6564..5728ebd898 100644 --- a/libavformat/mov_chan.c +++ b/libavformat/mov_chan.c @@ -428,8 +428,7 @@ uint64_t ff_mov_get_channel_layout(uint32_t tag, uint32_t bitmap) int i, channels; const struct MovChannelLayoutMap *layout_map; - /* handle the use of the channel descriptions */ - /* TODO: map MOV channel labels to Libav channels */ + /* use ff_mov_get_channel_label() to build a layout instead */ if (tag == MOV_CH_LAYOUT_USE_DESCRIPTIONS) return 0; @@ -451,6 +450,19 @@ uint64_t ff_mov_get_channel_layout(uint32_t tag, uint32_t bitmap) return layout_map[i].layout; } +uint32_t ff_mov_get_channel_label(uint32_t label) +{ + if (label == 0) + return 0; + if (label <= 18) + return 1U << (label - 1); + if (label == 38) + return AV_CH_STEREO_LEFT; + if (label == 39) + return AV_CH_STEREO_RIGHT; + return 0; +} + uint32_t ff_mov_get_channel_layout_tag(enum CodecID codec_id, uint64_t channel_layout, uint32_t *bitmap) |