summaryrefslogtreecommitdiff
path: root/rotord/src/rotor.h
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2014-02-07 13:24:00 +0000
committerTim Redfern <tim@eclectronics.org>2014-02-07 13:24:00 +0000
commit22fd121880876005d312827a6a35c9f41c292bb2 (patch)
treef7527a3ae626b8a5915da2a0a91e20a7958593cd /rotord/src/rotor.h
parent775dc6bcc5f5c23319bb92315140c154a79fe6f8 (diff)
curiouser and curiouser
Diffstat (limited to 'rotord/src/rotor.h')
-rw-r--r--rotord/src/rotor.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/rotord/src/rotor.h b/rotord/src/rotor.h
index eb8dce9..a7cdbdc 100644
--- a/rotord/src/rotor.h
+++ b/rotord/src/rotor.h
@@ -933,6 +933,7 @@ namespace Rotor {
return false;
}
bool get_frame(double wanted,const Frame_spec &frame){
+ wanted=max(0.0,wanted);
if (attributes["frame_mode"]->intVal==VIDEOFRAMES_blend){
if (((int)wanted)!=lastframe){
//get a new pair of frames possibly by switching the next one
@@ -966,8 +967,9 @@ namespace Rotor {
Poco::Logger& logger = Poco::Logger::get(Log_name);
logger.error("Video_loader failed to seek frame "+toString(wanted)+" of "+attributes["filename"]->value);
- if (image.w>0) return &image; //just return the previous frame if possible
- else return nullptr;
+ //if (image.w>0) return true; //just return the previous frame if possible
+ //else
+ return false;
}
image.setup_fromRGB(frame.w,frame.h,players[clip_loaded].frame->Data[0],players[clip_loaded].frame->Linesize[0]-(frame.w*3));
}
@@ -996,7 +998,7 @@ namespace Rotor {
players.resize(attributes["filenames"]->vals.size());
ph=seg==0?ph:fmod(ph,seg);
if (clip_loaded!=wv){
- if (load(wv)) {
+ if (load(wv)) { //always checks if loading is succesful
clip_loaded=wv;
isLoaded=true;
}
@@ -1005,7 +1007,7 @@ namespace Rotor {
// clip_loaded=-1;
//}
}
- if (isLoaded){
+ if (isLoaded){ //always checks if loading is succesful
int wanted=0.0;
int thisframe=((Time_spec)frame).frame();
double clipframerate=(parameters["framerate"]->value==0.0?players[clip_loaded].get_framerate():parameters["framerate"]->value);