You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Fixed a problem with audio time map deltas, and being slowed down instead of sped up
This commit is contained in:
@@ -396,7 +396,7 @@ tr1::shared_ptr<Frame> Clip::get_time_mapped_frame(tr1::shared_ptr<Frame> frame,
|
||||
}
|
||||
|
||||
// Resample audio to be X times faster (where X is the delta of the repeat fraction)
|
||||
resampler->SetBuffer(samples, float(number_of_samples) / float(start));
|
||||
resampler->SetBuffer(samples, float(start) / float(number_of_samples));
|
||||
|
||||
// Resample data, and return new buffer pointer
|
||||
AudioSampleBuffer *buffer = resampler->GetResampledBuffer();
|
||||
|
||||
30
src/Main.cpp
30
src/Main.cpp
@@ -38,7 +38,7 @@ int main()
|
||||
Timeline t(640, 360, Framerate(24,1));
|
||||
|
||||
// Add some clips
|
||||
Clip c1(new FFmpegReader("/home/jonathan/Videos/sintel-1024-stereo.mp4"));
|
||||
Clip c1(new FFmpegReader("/home/jonathan/Videos/sintel_trailer-720p.mp4"));
|
||||
c1.Position(0.0);
|
||||
|
||||
// LINEAR Reverse
|
||||
@@ -46,24 +46,28 @@ int main()
|
||||
//c1.time.AddPoint(500, 1, LINEAR);
|
||||
|
||||
// LINEAR Slow Reverse (sounds wavy, due to periodic repeated frames)
|
||||
//c1.time.AddPoint(1, 500, LINEAR);
|
||||
//c1.time.AddPoint(500, 100, LINEAR);
|
||||
c1.time.AddPoint(1, 500, LINEAR);
|
||||
c1.time.AddPoint(500, 100, LINEAR);
|
||||
|
||||
// LINEAR Fast Reverse (sounds wavy, due to periodic repeated frames)
|
||||
//c1.time.AddPoint(1, 600, LINEAR);
|
||||
//c1.time.AddPoint(500, 1, LINEAR);
|
||||
|
||||
// BEZIER Reverse
|
||||
openshot::Point p1(1,500);
|
||||
p1.handle_left = Coordinate(1,500);
|
||||
p1.handle_right = Coordinate(250,500);
|
||||
// LINEAR Slow Forward
|
||||
//c1.time.AddPoint(1, 1000, LINEAR);
|
||||
//c1.time.AddPoint(500, 1, LINEAR);
|
||||
|
||||
openshot::Point p2(500,100);
|
||||
p1.handle_left = Coordinate(500,350);
|
||||
p1.handle_right = Coordinate(500,100);
|
||||
|
||||
c1.time.AddPoint(p1);
|
||||
c1.time.AddPoint(p2);
|
||||
// // BEZIER Reverse
|
||||
// openshot::Point p1(1,500);
|
||||
// p1.handle_left = Coordinate(1,500);
|
||||
// p1.handle_right = Coordinate(250,500);
|
||||
//
|
||||
// openshot::Point p2(500,100);
|
||||
// p1.handle_left = Coordinate(500,350);
|
||||
// p1.handle_right = Coordinate(500,100);
|
||||
//
|
||||
// c1.time.AddPoint(p1);
|
||||
// c1.time.AddPoint(p2);
|
||||
|
||||
// c1.time.AddPoint(1, 500, LINEAR);
|
||||
// c1.time.AddPoint(500, 1, LINEAR);
|
||||
|
||||
Reference in New Issue
Block a user