File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -126,17 +126,12 @@ void ICodec::setCodec( const ECodecType type, const AVCodecID codecId )
126
126
}
127
127
128
128
if ( type == eCodecTypeEncoder )
129
- {
130
129
_avCodec = avcodec_find_encoder ( codecId );
131
- if ( _avCodecContext )
132
- _avCodecContext->codec = _avCodec;
133
- }
134
130
else if ( type == eCodecTypeDecoder )
135
- {
136
131
_avCodec = avcodec_find_decoder ( codecId );
137
- if ( _avCodecContext )
138
- _avCodecContext-> codec = _avCodec;
139
- }
132
+
133
+ if ( _avCodecContext )
134
+ _avCodecContext-> codec = _avCodec;
140
135
}
141
136
142
137
void ICodec::allocateContext ()
@@ -146,6 +141,7 @@ void ICodec::allocateContext()
146
141
{
147
142
throw std::runtime_error ( " unable to allocate the codecContext and set its fields to default values" );
148
143
}
144
+ _avCodecContext->codec = _avCodec;
149
145
}
150
146
151
147
void ICodec::loadCodecOptions ()
You can’t perform that action at this time.
0 commit comments