Skip to content

Commit 31016f4

Browse files
author
Clement Champetier
committed
common: add getDescriptionFromErrorCode
1 parent d7b0296 commit 31016f4

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/AvTranscoder/common.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,11 @@ void setLogLevel( const int level )
1717
av_log_set_level( level );
1818
}
1919

20+
std::string AvExport getDescriptionFromErrorCode( const int code )
21+
{
22+
char err[AV_ERROR_MAX_STRING_SIZE];
23+
av_strerror( code, err, sizeof(err) );
24+
return std::string( err );
25+
}
26+
2027
}

src/AvTranscoder/common.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ void AvExport preloadCodecsAndFormats();
6565
*/
6666
void AvExport setLogLevel( const int level );
6767

68+
69+
/// Get the string description corresponding to the error code provided by ffmpeg/libav
70+
std::string AvExport getDescriptionFromErrorCode( const int code );
71+
6872
}
6973

7074
#endif

0 commit comments

Comments
 (0)