Skip to content

Commit

Permalink
[mkv] Recheck chan and fq by decoding extradata if they are there
Browse files Browse the repository at this point in the history
  • Loading branch information
mean committed Mar 18, 2018
1 parent e9fc31c commit b889f81
Showing 1 changed file with 31 additions and 8 deletions.
39 changes: 31 additions & 8 deletions avidemux_plugins/ADM_demuxers/Matroska/ADM_mkvEntries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "ADM_mkv.h"

#include "mkv_tags.h"

#include "ADM_aacinfo.h"
class entryDesc
{
public:
Expand Down Expand Up @@ -281,13 +281,36 @@ uint8_t mkvHeader::analyzeOneTrack(void *head,uint32_t headlen)
}
}
//**
if(entry.fcc==WAV_AAC && !entry.extraDataLen)
{
ADM_info("Recreating aac extradata..\n");
entry.extraData = new uint8_t[5];
createAACExtraData(entry.codecId.c_str(),&entry);
}

if(entry.fcc==WAV_AAC)
{
if(!entry.extraDataLen)
{
ADM_info("Recreating aac extradata..\n");
entry.extraData = new uint8_t[5];
createAACExtraData(entry.codecId.c_str(),&entry);
}else
{
// check AAC infoata
AacAudioInfo info;
if(ADM_getAacInfoFromConfig(entry.extraDataLen,entry.extraData,info))
{
ADM_info("Decoding AAC extra data gives :\n");
ADM_info("Fq= %d\n",info.frequency);
ADM_info("channels= %d\n",info.channels);
ADM_info("SBR= %d\n",info.sbr);
entry.chan=info.channels;
if(info.sbr)
{
entry.fq=info.frequency*2;
}
else
{
entry.fq=info.frequency;
}
}

}
}
//**
t->language=entry.language;
t->wavHeader.encoding=entry.fcc;
Expand Down

0 comments on commit b889f81

Please sign in to comment.