From 241aa15581a22a0bf71043fc96415e67b0bb9bc0 Mon Sep 17 00:00:00 2001 From: Christian Feldmann Date: Tue, 17 Oct 2023 16:50:02 +0200 Subject: [PATCH] Guess packet type from video packets only --- YUViewLib/src/filesource/FileSourceFFmpegFile.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/YUViewLib/src/filesource/FileSourceFFmpegFile.cpp b/YUViewLib/src/filesource/FileSourceFFmpegFile.cpp index 43a8cb61f..4e34b631b 100644 --- a/YUViewLib/src/filesource/FileSourceFFmpegFile.cpp +++ b/YUViewLib/src/filesource/FileSourceFFmpegFile.cpp @@ -588,7 +588,8 @@ bool FileSourceFFmpegFile::goToNextPacket(bool videoPacketsOnly) (int)this->currentPacket.getDTS(), this->currentPacket.getFlagKeyframe() ? " - keyframe" : ""); - if (this->packetDataFormat == PacketDataFormat::Unknown) + if (this->currentPacket.getPacketType() == PacketType::VIDEO && + this->packetDataFormat == PacketDataFormat::Unknown) // This is the first video package that we find and we don't know what the format of the packet // data is. Guess the format from the data in the first package This format should not change // from packet to packet