summaryrefslogtreecommitdiff
path: root/media-libs/wxsvg/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-03-20 00:40:44 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-03-20 00:40:44 +0000
commit4cbcc855382a06088e2f016f62cafdbcb7e40665 (patch)
tree356496503d52354aa6d9f2d36126302fed5f3a73 /media-libs/wxsvg/files
parentfcc5224904648a8e6eb528d7603154160a20022f (diff)
gentoo resync : 20.03.2022
Diffstat (limited to 'media-libs/wxsvg/files')
-rw-r--r--media-libs/wxsvg/files/ffmpeg5.patch64
1 files changed, 64 insertions, 0 deletions
diff --git a/media-libs/wxsvg/files/ffmpeg5.patch b/media-libs/wxsvg/files/ffmpeg5.patch
new file mode 100644
index 000000000000..3b726ec79b5f
--- /dev/null
+++ b/media-libs/wxsvg/files/ffmpeg5.patch
@@ -0,0 +1,64 @@
+Index: wxsvg-1.5.23/include/wxSVG/mediadec_ffmpeg.h
+===================================================================
+--- wxsvg-1.5.23.orig/include/wxSVG/mediadec_ffmpeg.h
++++ wxsvg-1.5.23/include/wxSVG/mediadec_ffmpeg.h
+@@ -81,6 +81,7 @@ private:
+ bool OpenVideoDecoder();
+ void CloseVideoDecoder();
+ AVStream* GetVideoStream();
++ int64_t m_cur_dts;
+ };
+
+ #endif //FFMPEG_MEDIA_DECODER_H
+Index: wxsvg-1.5.23/src/mediadec_ffmpeg.cpp
+===================================================================
+--- wxsvg-1.5.23.orig/src/mediadec_ffmpeg.cpp
++++ wxsvg-1.5.23/src/mediadec_ffmpeg.cpp
+@@ -20,6 +20,7 @@
+ #define UINT64_C(val) val##ULL
+ #endif
+ extern "C" {
++#include <libavcodec/avcodec.h>
+ #include <libavformat/avformat.h>
+ #include <libswscale/swscale.h>
+ #include <libavutil/avutil.h>
+@@ -153,6 +154,9 @@ StreamType wxFfmpegMediaDecoder::GetStre
+ }
+
+ wxString wxFfmpegMediaDecoder::GetCodecName(unsigned int streamIndex) {
++#if LIBAVCODEC_VERSION_MAJOR >= 59
++ const
++#endif
+ AVCodec *codec = avcodec_find_decoder(m_formatCtx->streams[streamIndex]->codecpar->codec_id);
+ if (codec) {
+ return wxString(codec->name, wxConvLocal);
+@@ -193,6 +197,9 @@ bool wxFfmpegMediaDecoder::OpenVideoDeco
+
+ // find and open the decoder for the video stream
+ AVStream* stream = m_formatCtx->streams[m_videoStream];
++#if LIBAVCODEC_VERSION_MAJOR >= 59
++ const
++#endif
+ AVCodec* codec = avcodec_find_decoder(stream->codecpar->codec_id);
+ if (!codec)
+ return false;
+@@ -255,7 +262,11 @@ double wxFfmpegMediaDecoder::GetPosition
+ AVStream *st = GetVideoStream();
+ if (st == NULL)
+ return -1;
++#if LIBAVCODEC_VERSION_MAJOR >= 59
++ int64_t timestamp = m_cur_dts;
++#else
+ int64_t timestamp = st->cur_dts;
++#endif
+ if (timestamp == (int64_t)AV_NOPTS_VALUE)
+ return -1;
+ timestamp = av_rescale(timestamp, AV_TIME_BASE * (int64_t)st->time_base.num, st->time_base.den);
+@@ -308,6 +319,7 @@ wxImage wxFfmpegMediaDecoder::GetNextFra
+ uint8_t *rgbSrc[3] = { img.GetData(), NULL, NULL };
+ int rgbStride[3] = { 3 * m_width, 0, 0 };
+ sws_scale(imgConvertCtx, m_frame->data, m_frame->linesize, 0, m_codecCtx->height, rgbSrc, rgbStride);
++ m_cur_dts = packet.dts;
+ av_packet_unref(&packet);
+ sws_freeContext(imgConvertCtx);
+ return img;