Skip to content

Commit 586f854

Browse files
minor changes
1 parent 7aa151f commit 586f854

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

src/AvTranscoder/Description.hpp

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ extern "C" {
1010
}
1111

1212
#include <vector>
13+
#include <cstring>
1314

1415
std::vector<size_t> getVersion()
1516
{
@@ -24,26 +25,22 @@ std::vector<size_t> getVersion()
2425

2526
std::vector<std::string> getInputExtensions()
2627
{
27-
av_register_all(); // Warning: should be called only once
28+
av_register_all();
2829
std::vector<std::string> extensions;
29-
AVInputFormat* iFormat = av_iformat_next( NULL );
30-
while( iFormat != NULL )
30+
AVInputFormat* iFormat = NULL;
31+
32+
while( ( iFormat = av_iformat_next( iFormat ) ) )
3133
{
3234
if( iFormat->extensions != NULL )
3335
{
34-
const char* exts = iFormat->extensions;
35-
while( 1 )
36+
char* ext = const_cast<char*>( iFormat->extensions );
37+
38+
while( ext != NULL )
3639
{
37-
char* saveptr = NULL;
38-
char* ext = av_strtok( const_cast<char*>( exts ), ",", &saveptr );
39-
if( ! ext || ! saveptr )
40-
{
41-
break;
42-
}
4340
extensions.push_back( std::string( ext ) );
41+
ext = strtok( NULL, "," );
4442
}
4543
}
46-
iFormat = av_iformat_next( iFormat );
4744
}
4845
return extensions;
4946
}

src/AvTranscoder/Metadatas/DataStreamProperties.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ DataProperties dataStreamInfo( AVFormatContext* formatContext, const size_t inde
7070
DataProperties dp;
7171
dp.streamId = index;
7272

73-
AVCodecContext* codec_context = formatContext->streams[index]->codec;
73+
// AVCodecContext* codec_context = formatContext->streams[index]->codec;
7474

7575
// dp.codecName = codec_context->codec_name;
7676
// dp.codecLongName = codec_context->codec_name;

0 commit comments

Comments
 (0)