Increased the number of samples to look for gaps (based on the samples per frame value)

This commit is contained in:
Jonathan Thomas
2013-01-13 10:54:53 -06:00
parent 615be6603d
commit ebf3bad263
2 changed files with 7 additions and 6 deletions

View File

@@ -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;

View File

@@ -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<Frame> 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;