Skip to content

Commit 4da5603

Browse files
author
Clement Champetier
committed
FormatContext: fix isOpen value when open AVFormatContext
1 parent 90e3e5d commit 4da5603

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/AvTranscoder/file/FormatContext.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace avtranscoder
1010
FormatContext::FormatContext( const std::string& filename, int req_flags )
1111
: _avFormatContext( NULL )
1212
, _options()
13-
, _isOpen( true )
13+
, _isOpen( false )
1414
{
1515
int ret = avformat_open_input( &_avFormatContext, filename.c_str(), NULL, NULL );
1616
if( ret < 0 )
@@ -23,6 +23,7 @@ FormatContext::FormatContext( const std::string& filename, int req_flags )
2323
msg += err;
2424
throw std::ios_base::failure( msg );
2525
}
26+
_isOpen = true;
2627
loadOptions( _options, _avFormatContext, req_flags );
2728
}
2829

src/AvTranscoder/file/FormatContext.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class AvExport FormatContext
8686
private:
8787
AVFormatContext* _avFormatContext; ///< Has ownership
8888
OptionMap _options;
89-
const bool _isOpen; ///< Is the AVFormatContext open (in constructor with a filename)
89+
bool _isOpen; ///< Is the AVFormatContext open (in constructor with a filename)
9090
};
9191

9292
}

0 commit comments

Comments
 (0)