Skip to content

Commit 72311ca

Browse files
author
Clement Champetier
committed
AvInputStream: throw if try to read on non-bufferized input stream
Throw runtime_error in readNextPacket if try to read packet on non- bufferized input stream.
1 parent 4918995 commit 72311ca

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/AvTranscoder/AvInputStream.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ AvInputStream::~AvInputStream( )
4444

4545
bool AvInputStream::readNextPacket( DataStream& data )
4646
{
47+
if( ! m_bufferized )
48+
throw std::runtime_error( "Can't read packet on non-bufferized input stream." );
49+
4750
if( m_streamCache.empty() )
4851
m_inputFile->readNextPacket( m_streamIndex );
4952

0 commit comments

Comments
 (0)