Fixed a big audio bug, where varying timestamp values on low precision audio timebases (i.e. 1/1000) would leave small gaps in the audio wave. Also, fixed a few issues related to sample_rate getting lost between the reader and clip and timeline objects.

This commit is contained in:
Jonathan Thomas
2012-11-20 16:22:50 -06:00
parent 7e51c204f9
commit 495ca9dc9e
9 changed files with 35 additions and 58 deletions

View File

@@ -26,6 +26,10 @@ FrameMapper::FrameMapper(FileReaderBase *reader, Framerate target, Pulldown_Meth
info.video_timebase.num = target.GetFraction().den;
info.video_timebase.den = target.GetFraction().num;
info.video_length = round(info.duration * info.fps.ToDouble());
info.sample_rate = reader->info.sample_rate;
info.channels = reader->info.channels;
info.width = reader->info.width;
info.height = reader->info.height;
// Used to toggle odd / even fields
field_toggle = true;
@@ -252,6 +256,7 @@ tr1::shared_ptr<Frame> FrameMapper::GetFrame(int requested_frame) throw(ReaderCl
// Create a new frame
tr1::shared_ptr<Frame> frame(new Frame(requested_frame, 1, 1, "#000000", samples_in_frame, info.channels));
frame->SetSampleRate(info.sample_rate);
// Copy the image from the odd field (TODO: make this copy each field from the correct frames)
frame->AddImage(reader->GetFrame(mapped.Odd.Frame)->GetImage(), true);