Skip to content

Commit 204f975

Browse files
author
Clement Champetier
committed
ICodec: load specific codec options
1 parent db4d1c8 commit 204f975

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/AvTranscoder/codec/ICodec.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ void ICodec::setCodec( const ECodecType type, const AVCodecID codecId )
139139
}
140140
}
141141

142-
143142
void ICodec::allocateContext()
144143
{
145144
_avCodecContext = avcodec_alloc_context3( _avCodec );
@@ -152,9 +151,17 @@ void ICodec::allocateContext()
152151
void ICodec::loadCodecOptions()
153152
{
154153
if( _type == eCodecTypeEncoder )
154+
{
155155
loadOptions( _options, _avCodecContext, AV_OPT_FLAG_ENCODING_PARAM );
156+
// load specific options of the codec
157+
loadOptions( _options, _avCodecContext->priv_data, AV_OPT_FLAG_ENCODING_PARAM );
158+
}
156159
else if( _type == eCodecTypeDecoder )
160+
{
157161
loadOptions( _options, _avCodecContext, AV_OPT_FLAG_DECODING_PARAM );
162+
// load specific options of the codec
163+
loadOptions( _options, _avCodecContext->priv_data, AV_OPT_FLAG_DECODING_PARAM );
164+
}
158165
}
159166

160167
}

0 commit comments

Comments
 (0)