Skip to content

Commit d09c80f

Browse files
Merge branch 'avmaster'
2 parents 1337383 + bc1198e commit d09c80f

File tree

2 files changed

+21
-11
lines changed

2 files changed

+21
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ You can also use it in Java & Python for simpliest integration in projects.
99
#### Continuous Integration
1010

1111
###### Drone.io
12-
[![Build Status](https://drone.io/github.com/MarcAntoine-Arnaud/avTranscoder/status.png)](https://drone.io/github.com/MarcAntoine-Arnaud/avTranscoder/latest)
12+
[![Build Status](https://drone.io/github.com/avTranscoder/avTranscoder/status.png)](https://drone.io/github.com/avTranscoder/avTranscoder/latest)
1313

1414
#### Packaging
1515

src/AvTranscoder/OptionLoader.cpp

Lines changed: 20 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,15 +276,21 @@ 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

283283
// all video codec concerned
284284
if( videoCodecName == "" )
285285
{
286286
const AVPixFmtDescriptor* pixFmtDesc = NULL;
287+
288+
#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT( 51, 44, 0 )
289+
for( int pix_fmt = 0; pix_fmt < PIX_FMT_NB; ++pix_fmt )
290+
pixFmtDesc = &av_pix_fmt_descriptors[pix_fmt];
291+
#else
287292
while( ( pixFmtDesc = av_pix_fmt_desc_next( pixFmtDesc ) ) != NULL )
293+
#endif
288294
{
289295
if( ! pixFmtDesc->name )
290296
continue;
@@ -301,7 +307,11 @@ std::vector<std::string> OptionLoader::getPixelFormats ( const std::string& vide
301307
size_t pix_fmt = 0;
302308
while( videoCodec->pix_fmts[pix_fmt] != -1 )
303309
{
310+
#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT( 51, 44, 0 )
311+
const AVPixFmtDescriptor* pix_desc = &av_pix_fmt_descriptors[ videoCodec->pix_fmts[pix_fmt] ];
312+
#else
304313
const AVPixFmtDescriptor* pix_desc = av_pix_fmt_desc_get( videoCodec->pix_fmts[pix_fmt] );
314+
#endif
305315
if( ! pix_desc->name )
306316
continue;
307317
pixelFormats.push_back( std::string( pix_desc->name ) );

0 commit comments

Comments
 (0)