Skip to content

Commit

Permalink
[coreAudio,coreMuxer,audioDecoders/lav,demuxers/Matroska] Support Tru…
Browse files Browse the repository at this point in the history
…eHD audio tracks in Matroska containers
  • Loading branch information
eumagga0x2a committed Oct 12, 2021
1 parent 5e353f8 commit c4375ab
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions avidemux_core/ADM_coreAudio/include/ADM_audioCodecEnum.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#define WAV_NELLYMOSER 9901
#define WAV_UNKNOWN 9999
#define WAV_FLAC 61868 // dummy ID
#define WAV_TRUEHD 0x5254 // 0x44485254

#endif
//EOF
1 change: 1 addition & 0 deletions avidemux_core/ADM_coreAudio/src/ADM_audioStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ const char *getStrFromAudioCodec( uint32_t codec)
case WAV_ULAW: return QT_TRANSLATE_NOOP("adm","ULAW");
case WAV_IMAADPCM: return QT_TRANSLATE_NOOP("adm","IMA ADPCM");
case WAV_8BITS_UNSIGNED:return QT_TRANSLATE_NOOP("adm","8-bit PCM");
case WAV_TRUEHD: return QT_TRANSLATE_NOOP("adm","TrueHD");
}
ADM_warning("Unkown audio codec :%d (0x%x)\n",codec,codec);
return QT_TRANSLATE_NOOP("adm","Unknown codec");
Expand Down
1 change: 1 addition & 0 deletions avidemux_core/ADM_coreMuxer/src/ADM_coreMuxerFfmpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ bool muxerFFmpeg::initAudio(uint32_t nbAudioTrack,ADM_audioStream **audio)
par->codec_id = AV_CODEC_ID_AAC;
par->frame_size=audio[i]->getSamplesPerPacket();
break;
case WAV_TRUEHD: par->codec_id = AV_CODEC_ID_TRUEHD; par->frame_size = 40; break;
default:
printf("[FF]: Unsupported audio\n");
return false;
Expand Down
4 changes: 4 additions & 0 deletions avidemux_plugins/ADM_audioDecoders/ADM_ad_lav/ADM_ad_lav.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ static ad_supportedFormat Formats[]={
{0x706D,AD_HIGH_QUAL},
{WAV_EAC3,AD_MEDIUM_QUAL},
{WAV_OGG_VORBIS,AD_HIGH_QUAL},
{WAV_TRUEHD,AD_MEDIUM_QUAL}
};

DECLARE_AUDIO_DECODER(ADM_AudiocoderLavcodec, // Class
Expand Down Expand Up @@ -191,6 +192,9 @@ DECLARE_AUDIO_DECODER(ADM_AudiocoderLavcodec, // Class
codecID = AV_CODEC_ID_AAC;
_blockalign = 1;
break;
case WAV_TRUEHD:
codecID = AV_CODEC_ID_TRUEHD;
break;
default:
ADM_assert(0);
}
Expand Down
5 changes: 2 additions & 3 deletions avidemux_plugins/ADM_demuxers/Matroska/ADM_mkvTrackType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ MKVCC mkvCC[]=
{"A_MPEG/L2",0,WAV_MP2,""},
{"A_MPEG/L1",0,WAV_MP2,""},
{"A_OPUS",0,WAV_OPUS,""},



{"A_TRUEHD",0,WAV_TRUEHD,""},

{"A_MS/ACM",0,0x100001,"ACMX"},

// Video
Expand Down

0 comments on commit c4375ab

Please sign in to comment.