You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
fix logic for location.sample_start and location.frame update, fixes audio gaps
This commit is contained in:
@@ -1472,17 +1472,8 @@ AudioLocation FFmpegReader::GetAudioPTSLocation(long int pts)
|
||||
int orig_start = location.sample_start;
|
||||
|
||||
// Update sample start, to prevent gaps in audio
|
||||
if (previous_packet_location.sample_start <= samples_per_frame)
|
||||
{
|
||||
location.sample_start = previous_packet_location.sample_start;
|
||||
location.frame = previous_packet_location.frame;
|
||||
}
|
||||
else
|
||||
{
|
||||
// set to next frame (since we exceeded the # of samples on a frame)
|
||||
location.sample_start = 0;
|
||||
location.frame++;
|
||||
}
|
||||
location.sample_start = previous_packet_location.sample_start;
|
||||
location.frame = previous_packet_location.frame;
|
||||
|
||||
// Debug output
|
||||
ZmqLogger::Instance()->AppendDebugMethod("FFmpegReader::GetAudioPTSLocation (Audio Gap Detected)", "Source Frame", orig_frame, "Source Audio Sample", orig_start, "Target Frame", location.frame, "Target Audio Sample", location.sample_start, "pts", pts, "", -1);
|
||||
|
||||
Reference in New Issue
Block a user