Skip to content

Commit 37d8ea1

Browse files
author
Clement Champetier
committed
Description: fix getInputExtensions
* Fix algo when parse extensions.
1 parent 01cc980 commit 37d8ea1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/AvTranscoder/Description.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,18 @@ std::vector<std::string> getInputExtensions()
3838
if( iFormat->extensions != NULL )
3939
{
4040
// parse extensions
41-
char* ext = const_cast<char*>( iFormat->extensions );
41+
std::string exts = std::string( iFormat->extensions );
42+
char* ext = strtok( const_cast<char*>( exts.c_str() ), "," );
4243
while( ext != NULL )
4344
{
4445
extensions.push_back( std::string( ext ) );
4546
ext = strtok( NULL, "," );
4647
}
4748

4849
// parse name (name's format defines (in general) extensions )
49-
ext = const_cast<char*>( iFormat->name );
50+
// don't need to do it in recent LibAV/FFMpeg versions
51+
exts = std::string( iFormat->name );
52+
ext = strtok( const_cast<char*>( exts.c_str() ), "," );
5053
while( ext != NULL )
5154
{
5255
extensions.push_back( std::string( ext ) );

0 commit comments

Comments
 (0)