32 lines
1.3 KiB
Diff
32 lines
1.3 KiB
Diff
Index: ffmpegthumbs-4.8.1/ffmpegthumbs/ffmpegthumbnailer/moviedecoder.cpp
|
|
===================================================================
|
|
--- ffmpegthumbs-4.8.1.orig/ffmpegthumbs/ffmpegthumbnailer/moviedecoder.cpp
|
|
+++ ffmpegthumbs-4.8.1/ffmpegthumbs/ffmpegthumbnailer/moviedecoder.cpp
|
|
@@ -52,12 +52,14 @@ MovieDecoder::~MovieDecoder()
|
|
void MovieDecoder::initialize(const QString& filename)
|
|
{
|
|
av_register_all();
|
|
+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54,0,0)
|
|
avcodec_init();
|
|
+#endif
|
|
avcodec_register_all();
|
|
|
|
QFileInfo fileInfo(filename);
|
|
|
|
- if ((!m_FormatContextWasGiven) && av_open_input_file(&m_pFormatContext, fileInfo.absoluteFilePath().toUtf8().data(), NULL, 0, NULL) != 0) {
|
|
+ if ((!m_FormatContextWasGiven) && avformat_open_input(&m_pFormatContext, fileInfo.absoluteFilePath().toUtf8().data(), NULL, NULL) != 0) {
|
|
kDebug() << "Could not open input file: " << fileInfo.absoluteFilePath();
|
|
return;
|
|
}
|
|
@@ -89,7 +91,11 @@ void MovieDecoder::destroy()
|
|
}
|
|
|
|
if ((!m_FormatContextWasGiven) && m_pFormatContext) {
|
|
+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54,0,0)
|
|
av_close_input_file(m_pFormatContext);
|
|
+#else
|
|
+ avformat_close_input(&m_pFormatContext);
|
|
+#endif
|
|
m_pFormatContext = NULL;
|
|
}
|
|
|