diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-06-14 20:33:21 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-06-14 20:33:21 +0100 |
| commit | b438fa8772d071663692c6c936881e1f44590523 (patch) | |
| tree | adc46d1bc14f0294d28e2e9217aa12a4b694e139 | |
| parent | 2dd01db2ace9c2356f2e2419e4065e9994b74a65 (diff) | |
weird bugs with small files
| -rwxr-xr-x | rotord/libavwrapper.cpp | 2 | ||||
| -rwxr-xr-x | rotord/rotor.cpp | 6 |
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 ℑ } + //confusingly, crashes with files not made with ffmpeg/ short files? + return nullptr; }; |
