diff options
| author | Tim Redfern <tim@herge.(none)> | 2013-08-01 15:36:47 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@herge.(none)> | 2013-08-01 15:36:47 +0100 |
| commit | 163b7f165d40289c03cebb9d9d8c8618e01ef0db (patch) | |
| tree | 042e114b5299226ad52957247f1a5c8a21b9862b /rotord/src | |
| parent | 994a4bc5538b96f2811b653a7a8ccfa8fd2294b6 (diff) | |
video loader first frame tweak
Diffstat (limited to 'rotord/src')
| -rwxr-xr-x | rotord/src/libavwrapper.cpp | 1 | ||||
| -rwxr-xr-x | rotord/src/rotor.cpp | 4 |
2 files changed, 3 insertions, 2 deletions
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"<<endl; + cerr<<"Rotor: failed to seek frame "<<wanted<<endl; if (image.w>0) return ℑ //just return the previous frame if possible else return nullptr; }; |
