From ebf3bad263aa134b3a23dc36c6f7a15fa3fa38bb Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Sun, 13 Jan 2013 10:54:53 -0600 Subject: [PATCH] Increased the number of samples to look for gaps (based on the samples per frame value) --- src/FFmpegReader.cpp | 2 +- src/Main.cpp | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/FFmpegReader.cpp b/src/FFmpegReader.cpp index 97b609e5..aeb80631 100644 --- a/src/FFmpegReader.cpp +++ b/src/FFmpegReader.cpp @@ -1131,7 +1131,7 @@ audio_packet_location FFmpegReader::GetAudioPTSLocation(int pts) // Compare to previous audio packet (and fix small gaps due to varying PTS timestamps) - if (location.is_near(previous_packet_location, samples_per_frame, 1000)) + if (location.is_near(previous_packet_location, samples_per_frame, samples_per_frame)) { int orig_frame = location.frame; int orig_start = location.sample_start; diff --git a/src/Main.cpp b/src/Main.cpp index fe4e3dbb..56867b99 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -147,11 +147,12 @@ int main() /* WRITER ---------------- */ - FFmpegWriter w("/home/jonathan/output.webm"); + FFmpegWriter w("/home/jonathan/output.mp3"); // Set options - w.SetAudioOptions(true, "libvorbis", 48000, 2, 128000); - w.SetVideoOptions(true, "libvpx", Fraction(24,1), 720, 420, Fraction(1,1), false, false, 3000000); + //w.SetAudioOptions(true, "libvorbis", 48000, 2, 128000); + w.SetAudioOptions(true, "libmp3lame", 48000, 2, 128000); + //w.SetVideoOptions(true, "libvpx", Fraction(24,1), 720, 420, Fraction(1,1), false, false, 3000000); // Prepare Streams w.PrepareStreams(); @@ -167,8 +168,8 @@ int main() tr1::shared_ptr f = t.GetFrame(frame); if (f) { - //if (frame >= 13) - //f->Display(); + //if (frame >= 62) + // f->DisplayWaveform(); // Write frame cout << "queue frame " << frame << " (" << f->number << ", " << f << ")" << endl;