diff options
Diffstat (limited to 'rotord/libavwrapper.cpp')
| -rwxr-xr-x | rotord/libavwrapper.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/rotord/libavwrapper.cpp b/rotord/libavwrapper.cpp index 21a329c..7f99668 100755 --- a/rotord/libavwrapper.cpp +++ b/rotord/libavwrapper.cpp @@ -127,7 +127,7 @@ libav::decoder::decoder(PixelFormat pixelFormat) void libav::decoder::cleanup(){ - + mutex.lock(); if (NULL != Sctx) { sws_freeContext(Sctx); @@ -382,11 +382,18 @@ bool libav::decoder::readNextFrameWithPacket(int targetFrameIndex, AVPacket& pac #endif if(!finished) { if (packet.pts == AV_NOPTS_VALUE) - throw std::runtime_error(""); + packet.pts = 0; + //throw std::runtime_error(""); + //why does it want to throw an error here, isn't the frame succesfully decoded? + // + //when we allow these packets through we get + //[swscaler @ 0x9ef0c80] bad src image pointers + //trying to ignore timestamp below if (packet.size == 0) // packet.size==0 usually means EOF break; } - } while ( (!finished) || (pYuv->best_effort_timestamp < targetFrameIndex)); + //} while ( (!finished) || (pYuv->best_effort_timestamp < targetFrameIndex)); + } while (!finished); av_free_packet(&packet); @@ -653,7 +660,7 @@ libav::encoder::encoder(const char * file_name, int width, int height, float _fr if (aCtx->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE) audio_input_frame_size = 10000; else - audio_input_frame_size = aCtx->frame_size; + audio_input_frame_size = aCtx->frame_size; if (container->oformat->flags & AVFMT_GLOBALHEADER) @@ -1581,7 +1588,7 @@ bool libav::audioloader::setup(const std::string &filename){ //where is audio grunge coming from? signed/ unsigned? doesn't seem to be byte order.. // add +1 to data subscript with no effect - + //which? must be determined by format or layout of the channels //ALSO some kind of HEINOUS memory leak?? buffer[((sample_end+i)*frame->channels)+j]=s; |
