summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2013-06-14 20:33:21 +0100
committerTim Redfern <tim@eclectronics.org>2013-06-14 20:33:21 +0100
commitb438fa8772d071663692c6c936881e1f44590523 (patch)
treeadc46d1bc14f0294d28e2e9217aa12a4b694e139
parent2dd01db2ace9c2356f2e2419e4065e9994b74a65 (diff)
weird bugs with small files
-rwxr-xr-xrotord/libavwrapper.cpp2
-rwxr-xr-xrotord/rotor.cpp6
2 files changed, 5 insertions, 3 deletions
diff --git a/rotord/libavwrapper.cpp b/rotord/libavwrapper.cpp
index a5f2111..21a329c 100755
--- a/rotord/libavwrapper.cpp
+++ b/rotord/libavwrapper.cpp
@@ -467,7 +467,7 @@ bool libav::decoder::avtry(int result, const std::string& msg) {
if ((result < 0) && (result != AVERROR_EOF)) {
char buf[1024];
av_strerror(result, buf, sizeof(buf));
- std::string message = std::string("libav::Error: ") + msg + buf;
+ std::string message = std::string("libav::Error: ") + msg + " "+ buf;
//qDebug() << QString(message.c_str());
cerr<<message<<endl;
return false;
diff --git a/rotord/rotor.cpp b/rotord/rotor.cpp
index 2fa5183..37af5a1 100755
--- a/rotord/rotor.cpp
+++ b/rotord/rotor.cpp
@@ -377,12 +377,14 @@ Image* Video_loader::output(const Frame_spec &frame){
*/
if (isLoaded){
- int wanted=((int) (frame.time*frame.framerate))%(player.getNumberOfFrames()-2); //-2??
- if (!player.fetchFrame(frame.w,frame.h,wanted)) { cerr<<"Rotor: frame returned false"<<endl; };
+ int wanted=((int) (frame.time*frame.framerate))%(player.getNumberOfFrames()); //-2?? this would give division by zero
+ if (!player.fetchFrame(frame.w,frame.h,wanted)) { cerr<<"Rotor: frame returned false"<<endl; return nullptr; };
image.setup_fromRGB(frame.w,frame.h,player.pFrameRGB->data[0]);
return &image;
}
+ //confusingly, crashes with files not made with ffmpeg/ short files?
+
return nullptr;
};