summaryrefslogtreecommitdiff
path: root/rotord/rotor.cpp
diff options
context:
space:
mode:
authorTim Redfern <tim@herge.(none)>2013-07-05 16:34:57 +0100
committerTim Redfern <tim@herge.(none)>2013-07-05 16:34:57 +0100
commit2de9e3f35b537f36880f493aef2bc889a2a18b92 (patch)
tree31ecd47470540e884eaac8b99b55328a20ff92ed /rotord/rotor.cpp
parentafaf35edbad11bc7d71a6793116c229dcfc38f92 (diff)
preserve previous frame on seek fail
Diffstat (limited to 'rotord/rotor.cpp')
-rwxr-xr-xrotord/rotor.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/rotord/rotor.cpp b/rotord/rotor.cpp
index 3166de8..da711e5 100755
--- a/rotord/rotor.cpp
+++ b/rotord/rotor.cpp
@@ -391,9 +391,10 @@ Image* Video_loader::output(const Frame_spec &frame){
// int nothing=0;
//}
- if (!player.fetchFrame(frame.w,frame.h,wanted)) {
+ if (!player.fetchFrame(frame.w,frame.h,wanted)) { //seek fail
cerr<<"Rotor: frame returned false"<<endl;
- return nullptr;
+ if (image.w>0) return &image; //just return the previous frame if possible
+ else return nullptr;
};
image.setup_fromRGB(frame.w,frame.h,player.pFrameRGB->data[0]);
return &image;