Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Commit

Permalink
MpaDecFilter: avresample_open() before avresample_set_matrix(). way a…
Browse files Browse the repository at this point in the history
…gainst a bug in new versions of ffmpeg.

ffmpeg->libavresample can be updated now.
  • Loading branch information
v0lt committed Aug 6, 2012
1 parent fec2363 commit c545c6e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/filters/transform/MpaDecFilter/MpaDecFilter.cpp
Expand Up @@ -2500,6 +2500,14 @@ HRESULT CMpaDecFilter::Mixing(float* pOutput, WORD out_ch, DWORD out_layout, flo
av_opt_set_int(m_pAVRCxt, "out_channel_layout", out_layout, 0);
av_opt_set_int(m_pAVRCxt, "out_sample_fmt", AV_SAMPLE_FMT_FLT, 0);

// Open Resample Context
ret = avresample_open(m_pAVRCxt);
if (ret < 0) {
TRACE(_T("avresample_open failed\n"));
avresample_free(&m_pAVRCxt);
return S_FALSE;
}

// Create Matrix
double* matrix_dbl = (double*)av_mallocz(in_ch * out_ch * sizeof(*matrix_dbl));
// expand stereo
Expand Down Expand Up @@ -2564,14 +2572,6 @@ HRESULT CMpaDecFilter::Mixing(float* pOutput, WORD out_ch, DWORD out_layout, flo
avresample_free(&m_pAVRCxt);
return S_FALSE;
}

// Open Resample Context
ret = avresample_open(m_pAVRCxt);
if (ret < 0) {
TRACE(_T("avresample_open failed\n"));
avresample_free(&m_pAVRCxt);
return S_FALSE;
}
}

if (m_pAVRCxt) {
Expand Down

0 comments on commit c545c6e

Please sign in to comment.