Skip to content

Commit b4d17c7

Browse files
author
Clement Champetier
committed
OutputFile: symmetry between beginWrap & endWrap
1 parent 6ddfb4a commit b4d17c7

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/AvTranscoder/file/OutputFile.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ OutputFile::OutputFile( const std::string& filename )
1515
, _previousProcessedStreamDuration( 0.0 )
1616
{
1717
_formatContext.setOutputFormat( _filename );
18-
_formatContext.openRessource( _filename, AVIO_FLAG_WRITE );
1918
}
2019

2120
OutputFile::~OutputFile()
@@ -90,9 +89,12 @@ bool OutputFile::beginWrap( )
9089
{
9190
LOG_DEBUG( "Begin wrap of OutputFile" )
9291

92+
_formatContext.openRessource( _filename, AVIO_FLAG_WRITE );
9393
_formatContext.writeHeader();
94+
9495
_frameCount.clear();
9596
_frameCount.resize( _outputStreams.size(), 0 );
97+
9698
return true;
9799
}
98100

src/AvTranscoder/file/OutputFile.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,16 @@ class AvExport OutputFile : public IOutputFile
3333
IOutputStream& addAudioStream( const AudioCodec& audioDesc );
3434
IOutputStream& addDataStream( const DataCodec& dataDesc );
3535

36+
/**
37+
* @brief Open ressource and write header.
38+
*/
3639
bool beginWrap();
40+
3741
IOutputStream::EWrappingStatus wrap( const CodedData& data, const size_t streamId );
42+
43+
/**
44+
* @brief Close ressource and write trailer.
45+
*/
3846
bool endWrap();
3947

4048
/**

0 commit comments

Comments
 (0)