diff -ur ../ffmpegthumbs-4.14.3-orig/ffmpegthumbnailer/moviedecoder.cpp ./ffmpegthumbnailer/moviedecoder.cpp
--- ../ffmpegthumbs-4.14.3-orig/ffmpegthumbnailer/moviedecoder.cpp 2014-08-16 06:04:31.000000000 +0900
+++ ./ffmpegthumbnailer/moviedecoder.cpp 2016-03-03 01:30:47.000000000 +0900
- m_pFrame = avcodec_alloc_frame();
+ m_pFrame = av_frame_alloc();
- avcodec_get_frame_defaults(m_pFrame);
+ av_frame_unref(m_pFrame);
int scaledWidth, scaledHeight;
- convertAndScaleFrame(PIX_FMT_RGB24, scaledSize, maintainAspectRatio, scaledWidth, scaledHeight);
+ convertAndScaleFrame(AV_PIX_FMT_RGB24, scaledSize, maintainAspectRatio, scaledWidth, scaledHeight);
videoFrame.width = scaledWidth;
videoFrame.height = scaledHeight;
memcpy((&(videoFrame.frameData.front())), m_pFrame->data[0], videoFrame.lineSize * videoFrame.height);
-void MovieDecoder::convertAndScaleFrame(PixelFormat format, int scaledSize, bool maintainAspectRatio, int& scaledWidth, int& scaledHeight)
+void MovieDecoder::convertAndScaleFrame(AVPixelFormat format, int scaledSize, bool maintainAspectRatio, int& scaledWidth, int& scaledHeight)
calculateDimensions(scaledSize, maintainAspectRatio, scaledWidth, scaledHeight);
SwsContext* scaleContext = sws_getContext(m_pVideoCodecContext->width, m_pVideoCodecContext->height,
-void MovieDecoder::createAVFrame(AVFrame** avFrame, quint8** frameBuffer, int width, int height, PixelFormat format)
+void MovieDecoder::createAVFrame(AVFrame** avFrame, quint8** frameBuffer, int width, int height, AVPixelFormat format)
- *avFrame = avcodec_alloc_frame();
+ *avFrame = av_frame_alloc();
int numBytes = avpicture_get_size(format, width, height);
*frameBuffer = reinterpret_cast<quint8*>(av_malloc(numBytes));
diff -ur ../ffmpegthumbs-4.14.3-orig/ffmpegthumbnailer/moviedecoder.h ./ffmpegthumbnailer/moviedecoder.h
--- ../ffmpegthumbs-4.14.3-orig/ffmpegthumbnailer/moviedecoder.h 2014-08-16 06:04:31.000000000 +0900
+++ ./ffmpegthumbnailer/moviedecoder.h 2016-03-03 01:24:37.000000000 +0900
bool decodeVideoPacket();
- void convertAndScaleFrame(PixelFormat format, int scaledSize, bool maintainAspectRatio, int& scaledWidth, int& scaledHeight);
- void createAVFrame(AVFrame** avFrame, quint8** frameBuffer, int width, int height, PixelFormat format);
+ void convertAndScaleFrame(AVPixelFormat format, int scaledSize, bool maintainAspectRatio, int& scaledWidth, int& scaledHeight);
+ void createAVFrame(AVFrame** avFrame, quint8** frameBuffer, int width, int height, AVPixelFormat format);
void calculateDimensions(int squareSize, bool maintainAspectRatio, int& destWidth, int& destHeight);