From 163b7f165d40289c03cebb9d9d8c8618e01ef0db Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Thu, 1 Aug 2013 15:36:47 +0100 Subject: video loader first frame tweak --- rotord/src/libavwrapper.cpp | 1 + rotord/src/rotor.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'rotord/src') diff --git a/rotord/src/libavwrapper.cpp b/rotord/src/libavwrapper.cpp index c544b33..4e545ac 100755 --- a/rotord/src/libavwrapper.cpp +++ b/rotord/src/libavwrapper.cpp @@ -888,6 +888,7 @@ bool libav::exporter::record(std::string filename){ video_st = add_stream(oc, &video_codec, fmt->video_codec); } if (fmt->audio_codec != AV_CODEC_ID_NONE) { + //audio_st = add_stream(oc, &audio_codec, fmt->audio_codec); audio_st = add_stream(oc, &audio_codec, fmt->audio_codec); } diff --git a/rotord/src/rotor.cpp b/rotord/src/rotor.cpp index cf645c6..7580fee 100755 --- a/rotord/src/rotor.cpp +++ b/rotord/src/rotor.cpp @@ -286,10 +286,10 @@ bool Video_loader::load(const string &filename){ Image* Video_loader::output(const Frame_spec &frame){ if (isLoaded){ - int wanted=(((int) ((frame.time*frame.framerate)+0.5))%(player.getNumberOfFrames())); //+1 is necessary because 1st frame in a video is number 1? + int wanted=(((int) ((frame.time*frame.framerate)+0.5))%(player.getNumberOfFrames()-1))+1; //+1 is necessary because 1st frame in a video is number 1? if (!player.fetchFrame(frame.w,frame.h,wanted)) { //seek fail - cerr<<"Rotor: failed to seek frame"<0) return ℑ //just return the previous frame if possible else return nullptr; }; -- cgit v1.2.3