Skip to content

Commit 7d0e27d

Browse files
author
Clement Champetier
committed
OptionLoader: refactoring
* Backward compatibility: always the old version in first. * getPixelFormats: no spaces between the name of the function and its list of parameters.
1 parent c67aef5 commit 7d0e27d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/AvTranscoder/OptionLoader.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ OptionLoader::OptionLoader()
6565
AVCodec* c = NULL;
6666
while( ( c = av_codec_next( c ) ) != NULL )
6767
{
68-
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 53, 34, 0 )
69-
if( ! c->encode2 )
68+
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 53, 34, 0 )
69+
if( ! c->encode )
7070
continue;
7171
#else
72-
if( ! c->encode )
72+
if( ! c->encode2 )
7373
continue;
7474
#endif
7575
switch( c->type )
@@ -153,10 +153,10 @@ OptionLoader::OptionMap OptionLoader::loadVideoCodecOptions()
153153
// iterate on codecs
154154
while( _codec )
155155
{
156-
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 53, 34, 0 )
157-
if( _codec->encode2 )
158-
#else
156+
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 53, 34, 0 )
159157
if( _codec->encode )
158+
#else
159+
if( _codec->encode2 )
160160
#endif
161161
{
162162
// add only video codec
@@ -189,10 +189,10 @@ OptionLoader::OptionMap OptionLoader::loadAudioCodecOptions()
189189
// iterate on codecs
190190
while( _codec )
191191
{
192-
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 53, 34, 0 )
193-
if( _codec->encode2 )
194-
#else
192+
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 53, 34, 0 )
195193
if( _codec->encode )
194+
#else
195+
if( _codec->encode2 )
196196
#endif
197197
{
198198
// add only audio codec
@@ -276,7 +276,7 @@ OptionLoader::OptionArray OptionLoader::loadOptions( void* av_class, int req_fla
276276
return options;
277277
}
278278

279-
std::vector<std::string> OptionLoader::getPixelFormats ( const std::string& videoCodecName ) const
279+
std::vector<std::string> OptionLoader::getPixelFormats( const std::string& videoCodecName ) const
280280
{
281281
std::vector<std::string> pixelFormats;
282282

0 commit comments

Comments
 (0)