Merge branch 'master' into zma_to_thread

This commit is contained in:
Isaac Connor
2019-11-30 14:59:39 -05:00
267 changed files with 7912 additions and 7272 deletions

View File

@@ -51,46 +51,10 @@ zm_packetqueue::~zm_packetqueue() {
* Thus it will ensure that the same packet never gets queued twice.
*/
bool zm_packetqueue::queuePacket( ZMPacket* zm_packet ) {
bool zm_packetqueue::queuePacket(ZMPacket* zm_packet) {
Debug(4, "packetqueue queuepacket, first_video_packet_index is %d", first_video_packet_index);
mutex.lock();
#if 0
if ( zm_packet->image_index != -1 ) {
// It's a video packet
// If we can never queue the same packet, then they can never go past
if ( zm_packet->image_index == first_video_packet_index ) {
Debug(2, "queuing packet that is already on the queue(%d)", zm_packet->image_index);
while ( pktQueue.size() ) {
mutex.unlock();
ZMPacket *p = popPacket();
Debug(2,"Front packet index: %d", p->image_index);
mutex.lock();
if ( p->codec_type != AVMEDIA_TYPE_VIDEO ) {
Debug(2, "Deleting audio frame(%d)", p->image_index);
delete p;
p = NULL;
}
Debug(2,"pktQueue.size(%d)", pktQueue.size());
if ( p->image_index == zm_packet->image_index )
break;
} // end while there are packets at the head of the queue that are not this one
if ( analysis_it == pktQueue.end() ) {
// Analsys_it should only point to end when queue is empty
Debug(2,"pointing analysis_it to begining");
analysis_it = pktQueue.begin();
}
}
if ( first_video_packet_index == -1 ) {
// Initialize the first_video_packet indicator
first_video_packet_index = zm_packet->image_index;
} // end if
video_packet_count += 1;
} // end if queuing a video packet
#endif
if ( zm_packet->packet.stream_index == video_stream_id ) {
video_packet_count += 1;
}