Skip to content

Commit e10930f

Browse files
author
Clement Champetier
committed
file: add log when read next packets
1 parent 630915d commit e10930f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/AvTranscoder/file/InputFile.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ bool InputFile::readNextPacket( CodedData& data, const size_t streamIndex )
6363
const int ret = av_read_frame( &_formatContext.getAVFormatContext(), &data.getAVPacket() );
6464
if( ret < 0 ) // error or end of file
6565
{
66+
LOG_INFO( "No more data to read on file '" << _filename << "'" )
6667
return false;
6768
}
6869

@@ -71,6 +72,7 @@ bool InputFile::readNextPacket( CodedData& data, const size_t streamIndex )
7172
const int packetStreamIndex = data.getAVPacket().stream_index;
7273
if( packetStreamIndex == (int)streamIndex )
7374
{
75+
LOG_DEBUG( "Get a packet data of the stream " << streamIndex )
7476
nextPacketFound = true;
7577
}
7678
// else add the packet data to the stream cache

src/AvTranscoder/stream/InputStream.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,14 @@ bool InputStream::readNextPacket( CodedData& data )
5858
// if packet is already cached
5959
if( ! _streamCache.empty() )
6060
{
61+
LOG_DEBUG( "Get packet data of stream " << _streamIndex << " from the cache" )
6162
data.copyData( _streamCache.front().getData(), _streamCache.front().getSize() );
6263
_streamCache.pop();
6364
}
6465
// else read next packet
6566
else
6667
{
68+
LOG_DEBUG( "Read next packet" )
6769
return _inputFile->readNextPacket( data, _streamIndex ) && _streamCache.empty();
6870
}
6971

@@ -120,8 +122,12 @@ void InputStream::addPacket( AVPacket& packet )
120122
{
121123
// Do not cache data if the stream is declared as unused in process
122124
if( ! _isActivated )
125+
{
126+
LOG_DEBUG( "Do not add a packet data for the stream " << _streamIndex << " to the cache: stream not activated" )
123127
return;
128+
}
124129

130+
LOG_DEBUG( "Add a packet data for the stream " << _streamIndex << " to the cache" )
125131
_streamCache.push( CodedData() );
126132
_streamCache.back().copyData( packet.data, packet.size );
127133
}

0 commit comments

Comments
 (0)