Hi all,
I have developed a MKV media source, it's ok to play video, but audio is not, and i have check aduio parameter, it's correct. This is my config and file info:
WAVEFORMATEX afmt;
WAVEFORMATEX* wfe = &afmt;
ZeroMemory(wfe, sizeof(WAVEFORMATEX));
wfe->nChannels = Channels;
wfe->nSamplesPerSec = SamplingFrequency;
wfe->wBitsPerSample = BitDepth;
wfe->wBitsPerSample = wfe->wBitsPerSample==0?16:wfe->wBitsPerSample;
wfe->nBlockAlign = (WORD)((wfe->nChannels * wfe->wBitsPerSample) / 8);
wfe->nAvgBytesPerSec = wfe->nSamplesPerSec * wfe->nBlockAlign;
int size = sizeof(HEAACWAVEINFO) + CodecPrivate.GetCount();
HEAACWAVEINFO* pWaveInfo = (HEAACWAVEINFO*)malloc(size);
memset(pWaveInfo, 0, size);
memcpy(&(pWaveInfo->wfx), wfe, sizeof(WAVEFORMATEX));
pWaveInfo->wAudioProfileLevelIndication = 0xfe;
pWaveInfo->wPayloadType = 0;//raw aac
pWaveInfo->wStructType = 0;
pWaveInfo->wfx.cbSize = size- sizeof(WAVEFORMATEX);
if(CodecPrivate.GetCount() > 0)
memcpy((BYTE*)(pWaveInfo + 1),CodecPrivate.GetData(), CodecPrivate.GetCount());
HRESULT hr = MFCreateMediaType(&pType);
if (SUCCEEDED(hr))
{
hr = pType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Audio);
}
hr = MFInitMediaTypeFromWaveFormatEx(pType, (const WAVEFORMATEX*)pWaveInfo, size);
hr = pType->SetGUID(MF_MT_SUBTYPE, MFAudioFormat_AAC);
free(pWaveInfo);
pWaveInfo = NULL;
General
Unique ID : 230449330490480222084075823367818245987 (0xAD5EED37552E8C35B04FFC7FF40AF763)
Complete name : E:\clips\Jack_Jac_Attack__720p.mkv
Format : Matroska
Format version : Version 1
File size : 154 MiB
Duration : 4mn 44s
Overall bit rate : 4 542 Kbps
Encoded date : UTC 2012-09-05 04:07:16
Writing application : mkvmerge v2.4.0 ('Fumbling Towards Ecstasy') built on Oct 11 2008 20:13:15
Writing library : libebml v0.7.7 + libmatroska v0.8.1
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.0
Format settings, CABAC : No
Format settings, ReFrames : 1 frame
Codec ID : V_MPEG4/ISO/AVC
Duration : 4mn 44s
Nominal bit rate : 4 608 Kbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 23.976 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.209
Writing library : x264 core 80 r1378+57 6f6b50a
Encoding settings : cabac=0 / ref=1 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.0:0.0 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=3 / sliced_threads=0 / nr=0 / decimate=1 / mbaff=0 / constrained_intra=0 / bframes=0 / wpredp=2 / keyint=250 / keyint_min=25 / scenecut=40 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=4608 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Default : Yes
Forced : No
Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : Main
Codec ID : A_AAC
Duration : 4mn 44s
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 44.1 KHz
Compression mode : Lossy
Default : Yes
Forced : No
thanks
BR
Julis
haha