Skip to content

Commit fb7ea91

Browse files
author
Clement Champetier
committed
OptionLoader: suppress warning
* Array av_pix_fmt_descriptors is deprecated: use av_pix_fmt_desc_get function.
1 parent 8a98e1a commit fb7ea91

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/AvTranscoder/OptionLoader.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,12 +279,12 @@ std::vector<std::string> OptionLoader::getPixelFormats ( const std::string& vide
279279
// all video codec concerned
280280
if( videoCodecName == "" )
281281
{
282-
for( int pix_fmt = 0; pix_fmt < PIX_FMT_NB; ++pix_fmt )
282+
const AVPixFmtDescriptor* pixFmtDesc = NULL;
283+
while( ( pixFmtDesc = av_pix_fmt_desc_next( pixFmtDesc ) ) != NULL )
283284
{
284-
const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[pix_fmt];
285-
if( ! pix_desc->name )
285+
if( ! pixFmtDesc->name )
286286
continue;
287-
pixelFormats.push_back( std::string( pix_desc->name ) );
287+
pixelFormats.push_back( std::string( pixFmtDesc->name ) );
288288
}
289289
}
290290
// specific video codec
@@ -297,7 +297,7 @@ std::vector<std::string> OptionLoader::getPixelFormats ( const std::string& vide
297297
size_t pix_fmt = 0;
298298
while( videoCodec->pix_fmts[pix_fmt] != -1 )
299299
{
300-
const AVPixFmtDescriptor* pix_desc = &av_pix_fmt_descriptors[ videoCodec->pix_fmts[pix_fmt] ];
300+
const AVPixFmtDescriptor* pix_desc = av_pix_fmt_desc_get( videoCodec->pix_fmts[pix_fmt] );
301301
if( ! pix_desc->name )
302302
continue;
303303
pixelFormats.push_back( std::string( pix_desc->name ) );

0 commit comments

Comments
 (0)