Skip to content

Commit

Permalink
MpaDecFilter: заполняем m_pAVCtx->codec_tag, который нужен для некото…
Browse files Browse the repository at this point in the history
…рых кодеков.
  • Loading branch information
v0lt committed Dec 3, 2024
1 parent 5345e57 commit c64adb3
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/filters/transform/MpaDecFilter/FFAudioDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ static bool ParseVorbisTag(const CString& field_name, const CString& vorbisTag,
bool CFFAudioDecoder::Init(enum AVCodecID codecID, CMediaType* mediaType)
{
AVCodecID codec_id = AV_CODEC_ID_NONE;
unsigned int codec_tag = 0;
int samplerate = 0;
int channels = 0;
int bitdeph = 0;
Expand Down Expand Up @@ -293,11 +294,12 @@ bool CFFAudioDecoder::Init(enum AVCodecID codecID, CMediaType* mediaType)
codec_id = codecID;
if (mediaType->formattype == FORMAT_WaveFormatEx) {
WAVEFORMATEX *wfex = (WAVEFORMATEX *)mediaType->Format();
samplerate = wfex->nSamplesPerSec;
channels = wfex->nChannels;
bitdeph = wfex->wBitsPerSample;
block_align = wfex->nBlockAlign;
bitrate = wfex->nAvgBytesPerSec * 8;
codec_tag = wfex->wFormatTag;
samplerate = wfex->nSamplesPerSec;
channels = wfex->nChannels;
bitdeph = wfex->wBitsPerSample;
block_align = wfex->nBlockAlign;
bitrate = wfex->nAvgBytesPerSec * 8;
}
else if (mediaType->formattype == FORMAT_VorbisFormat2) {
VORBISFORMAT2 *vf2 = (VORBISFORMAT2 *)mediaType->Format();
Expand Down Expand Up @@ -349,6 +351,7 @@ bool CFFAudioDecoder::Init(enum AVCodecID codecID, CMediaType* mediaType)
}

m_pAVCtx->codec_id = codec_id;
m_pAVCtx->codec_tag = codec_tag;
m_pAVCtx->sample_rate = samplerate;
m_pAVCtx->ch_layout = ch_layout;
m_pAVCtx->bits_per_coded_sample = bitdeph;
Expand Down

0 comments on commit c64adb3

Please sign in to comment.