Skip to content

Commit 058af45

Browse files
clean reader of packets
1 parent 3c28458 commit 058af45

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/AvTranscoder/InputStream.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ bool InputStream::readNextPacket( DataStream& data ) const
3838
AVPacket packet;
3939
av_init_packet( &packet );
4040

41-
readNextPacket( packet );
41+
if( ! readNextPacket( packet ) )
42+
{
43+
return false;
44+
}
4245

4346
// is it possible to remove this copy ?
4447
// using : av_packet_unref ?
@@ -66,6 +69,8 @@ bool InputStream::readNextPacket( AVPacket& packet ) const
6669
{
6770
return true;
6871
}
72+
av_free_packet( &packet );
73+
av_init_packet( &packet );
6974
}
7075
}
7176

0 commit comments

Comments
 (0)