Add a warning when there are more videoframes in the packetqueue than image_buffers

This commit is contained in:
Isaac Connor 2018-10-15 11:33:58 -04:00
parent dae31d226b
commit 990c4b1b45
1 changed files with 4 additions and 0 deletions

View File

@ -867,6 +867,10 @@ int FfmpegCamera::CaptureAndRecord( Image &image, timeval recording, char* event
if ( packet.stream_index == mVideoStreamId ) {
if ( keyframe ) {
Debug(3, "Clearing queue");
if ( packetqueue->packet_count(mVideoStreamId) >= monitor->GetImageBufferCount() ) {
Warning("ImageBufferCount is too small. Either increase it or decrease time between keyframes");
}
packetqueue->clearQueue(monitor->GetPreEventCount(), mVideoStreamId);
packetqueue->queuePacket(&packet);
} else if ( packetqueue->size() ) {