|
|
@ -251,21 +251,24 @@ void FFmpeg_Decoder::open(const std::string &fname)
|
|
|
|
if(mOutputChannelLayout == 0)
|
|
|
|
if(mOutputChannelLayout == 0)
|
|
|
|
mOutputChannelLayout = av_get_default_channel_layout((*mStream)->codec->channels);
|
|
|
|
mOutputChannelLayout = av_get_default_channel_layout((*mStream)->codec->channels);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch(...) {
|
|
|
|
catch(...)
|
|
|
|
|
|
|
|
{
|
|
|
|
if(mStream)
|
|
|
|
if(mStream)
|
|
|
|
avcodec_close((*mStream)->codec);
|
|
|
|
avcodec_close((*mStream)->codec);
|
|
|
|
mStream = NULL;
|
|
|
|
mStream = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
if (mFormatCtx->pb->buffer != NULL)
|
|
|
|
if (mFormatCtx != NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
av_free(mFormatCtx->pb->buffer);
|
|
|
|
if (mFormatCtx->pb->buffer != NULL)
|
|
|
|
mFormatCtx->pb->buffer = NULL;
|
|
|
|
{
|
|
|
|
}
|
|
|
|
av_free(mFormatCtx->pb->buffer);
|
|
|
|
av_free(mFormatCtx->pb);
|
|
|
|
mFormatCtx->pb->buffer = NULL;
|
|
|
|
mFormatCtx->pb = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
av_free(mFormatCtx->pb);
|
|
|
|
|
|
|
|
mFormatCtx->pb = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
avformat_close_input(&mFormatCtx);
|
|
|
|
avformat_close_input(&mFormatCtx);
|
|
|
|
throw;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|