| 139 | } |
| 140 | |
| 141 | static void add_audio(int index, int linked_index, int track, hb_list_t *list_audio, BLURAY_STREAM_INFO *bdaudio, int substream_type, uint32_t codec, uint32_t codec_param, int attributes) |
| 142 | { |
| 143 | const char * codec_name; |
| 144 | hb_audio_t * audio; |
| 145 | iso639_lang_t * lang; |
| 146 | |
| 147 | audio = calloc( sizeof( hb_audio_t ), 1 ); |
| 148 | |
| 149 | audio->id = (substream_type << 16) | bdaudio->pid; |
| 150 | audio->config.index = index; |
| 151 | if (linked_index >= 0) |
| 152 | { |
| 153 | audio->config.list_linked_index = hb_list_init(); |
| 154 | hb_list_add_dup(audio->config.list_linked_index, |
| 155 | &linked_index, sizeof(linked_index)); |
| 156 | } |
| 157 | audio->config.in.reg_desc = STR4_TO_UINT32("HDMV"); |
| 158 | audio->config.in.stream_type = bdaudio->coding_type; |
| 159 | audio->config.in.substream_type = substream_type; |
| 160 | audio->config.in.codec = codec; |
| 161 | audio->config.in.codec_param = codec_param; |
| 162 | |
| 163 | switch( audio->config.in.codec ) |
| 164 | { |
| 165 | case HB_ACODEC_AC3: |
| 166 | codec_name = "AC3"; |
| 167 | break; |
| 168 | case HB_ACODEC_DCA: |
| 169 | codec_name = "DTS"; |
| 170 | break; |
| 171 | default: |
| 172 | { |
| 173 | if( audio->config.in.codec & HB_ACODEC_FF_MASK ) |
| 174 | { |
| 175 | switch( bdaudio->coding_type ) |
| 176 | { |
| 177 | case BLURAY_STREAM_TYPE_AUDIO_AC3PLUS: |
| 178 | codec_name = "E-AC3"; |
| 179 | break; |
| 180 | case BLURAY_STREAM_TYPE_AUDIO_DTSHD: |
| 181 | codec_name = "DTS-HD HRA"; |
| 182 | break; |
| 183 | case BLURAY_STREAM_TYPE_AUDIO_DTSHD_MASTER: |
| 184 | codec_name = "DTS-HD MA"; |
| 185 | break; |
| 186 | case BLURAY_STREAM_TYPE_AUDIO_LPCM: |
| 187 | codec_name = "BD LPCM"; |
| 188 | break; |
| 189 | case BLURAY_STREAM_TYPE_AUDIO_MPEG1: |
| 190 | codec_name = "MPEG1"; |
| 191 | break; |
| 192 | case BLURAY_STREAM_TYPE_AUDIO_MPEG2: |
| 193 | codec_name = "MPEG2"; |
| 194 | break; |
| 195 | case BLURAY_STREAM_TYPE_AUDIO_TRUHD: |
| 196 | codec_name = "TrueHD"; |
| 197 | break; |
| 198 | default: |
no test coverage detected