Print speaker allocation data block
Arnaud Vrac authored 7 years ago
Adam Jackson committed 7 years ago
994 | 994 | &CE_scan, |
995 | 995 | }; |
996 | 996 | |
997 | static const char *sadb_map[] = { | |
998 | "FL/FR", | |
999 | "LFE", | |
1000 | "FC", | |
1001 | "RL/RR", | |
1002 | "RC", | |
1003 | "FLC/FRC", | |
1004 | "RLC/RRC", | |
1005 | "FLW/FRW", | |
1006 | "FLH/FRH", | |
1007 | "TC", | |
1008 | "FCH", | |
1009 | }; | |
1010 | ||
1011 | static void | |
1012 | cea_sadb(unsigned char *x) | |
1013 | { | |
1014 | int length = x[0] & 0x1f; | |
1015 | int i; | |
1016 | ||
1017 | if (length >= 3) { | |
1018 | uint16_t sad = ((x[2] << 8) | x[1]); | |
1019 | ||
1020 | printf(" Speaker map:"); | |
1021 | ||
1022 | for (i = 0; i < ARRAY_SIZE(sadb_map); i++) { | |
1023 | if ((sad >> i) & 1) | |
1024 | printf(" %s", sadb_map[i]); | |
1025 | } | |
1026 | ||
1027 | printf("\n"); | |
1028 | } | |
1029 | } | |
1030 | ||
997 | 1031 | static void |
998 | 1032 | cea_vcdb(unsigned char *x) |
999 | 1033 | { |
1027 | 1061 | break; |
1028 | 1062 | case 0x04: |
1029 | 1063 | printf(" Speaker allocation data block\n"); |
1064 | cea_sadb(x); | |
1030 | 1065 | break; |
1031 | 1066 | case 0x05: |
1032 | 1067 | printf(" VESA DTC data block\n"); |