Skip to content

Commit 6e687c2

Browse files
committed
libav compatibility fix
1 parent 06ebd3f commit 6e687c2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/AvTranscoder/file/FormatContext.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ void FormatContext::addMetaData( const std::string& key, const std::string& valu
133133

134134
AVStream& FormatContext::addAVStream( const AVCodec& avCodec )
135135
{
136-
AVStream* stream = avformat_new_stream( _avFormatContext, &avCodec );
136+
// Need const_cast<AVCodec*> for libav versions < 54.34.
137+
AVStream* stream = avformat_new_stream( _avFormatContext, const_cast<AVCodec*>(&avCodec) );
137138
if( stream == NULL )
138139
{
139140
throw std::runtime_error( "unable to add new video stream" );

0 commit comments

Comments
 (0)