Skip to content

Commit 39ebb6c

Browse files
author
Clement Champetier
committed
FileProperties: added seek to the beginning of the stream before/after any deep analysis
1 parent 347d6ec commit 39ebb6c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/AvTranscoder/properties/FileProperties.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ FileProperties::FileProperties(const FormatContext& formatContext)
3030

3131
void FileProperties::extractStreamProperties(IProgress& progress, const EAnalyseLevel level)
3232
{
33+
// Returns at the beginning of the stream before any deep analysis
34+
if(level > eAnalyseLevelHeader && ! isRawFormat())
35+
const_cast<FormatContext*>(_formatContext)->seek(0, AVSEEK_FLAG_BACKWARD);
36+
3337
// clear properties
3438
clearStreamProperties();
3539

@@ -117,6 +121,10 @@ void FileProperties::extractStreamProperties(IProgress& progress, const EAnalyse
117121
const size_t unknownStreamIndex = _unknownStreams.at(streamIndex).getStreamIndex();
118122
_streams[unknownStreamIndex] = &_unknownStreams.at(streamIndex);
119123
}
124+
125+
// Returns at the beginning of the stream after any deep analysis
126+
if(level > eAnalyseLevelHeader && ! isRawFormat())
127+
const_cast<FormatContext*>(_formatContext)->seek(0, AVSEEK_FLAG_BACKWARD);
120128
}
121129

122130
std::string FileProperties::getFilename() const

0 commit comments

Comments
 (0)