summaryrefslogtreecommitdiff
path: root/rotord/libavwrapper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rotord/libavwrapper.cpp')
-rwxr-xr-xrotord/libavwrapper.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/rotord/libavwrapper.cpp b/rotord/libavwrapper.cpp
index 08d943f..d5ee9cf 100755
--- a/rotord/libavwrapper.cpp
+++ b/rotord/libavwrapper.cpp
@@ -224,7 +224,7 @@ bool libav::decoder::openUsingInitializedContainer(enum PixelFormat formatParam)
- numFrames=container->streams[videoStream]->nb_frames-1;
+ numFrames=container->streams[videoStream]->nb_frames-2;
if (numFrames<1){
//some codecs don't keep this info in the header
@@ -311,7 +311,9 @@ bool libav::decoder::fetchFrame(int w, int h,int targetFrameIndex)
reinit_buffers_and_scaler();
}
- fetchFrame(targetFrameIndex);
+ //seems to crash out on the last frame, if it can be caught should maybe decrement number of frames
+
+ return fetchFrame(targetFrameIndex);
}
bool libav::decoder::fetchFrame(int targetFrameIndex)