Experimental: adding debug logging to Frame destructor and QImage cleanup. Also, preventing processing of empty samples

This commit is contained in:
Jonathan Thomas
2022-07-26 15:09:57 -05:00
parent 285059baad
commit 89321d3bae
3 changed files with 12 additions and 0 deletions

View File

@@ -1465,6 +1465,12 @@ void FFmpegReader::ProcessAudioPacket(int64_t requested_frame) {
// Estimate the # of samples and the end of this packet's location (to prevent GAPS for the next timestamp)
int pts_remaining_samples = packet_samples / info.channels; // Adjust for zero based array
// Bail if no samples found
if (pts_remaining_samples == 0) {
ZmqLogger::Instance()->AppendDebugMethod("FFmpegReader::ProcessAudioPacket (No samples, bailing)", "packet_samples", packet_samples, "info.channels", info.channels, "pts_remaining_samples", pts_remaining_samples);
return;
}
// DEBUG (FOR AUDIO ISSUES) - Get the audio packet start time (in seconds)
int64_t adjusted_pts = audio_pts;
double audio_seconds = (double(adjusted_pts) * info.audio_timebase.ToDouble()) + pts_offset_seconds;