void-packages/srcpkgs/xbmc/patches/020_all_thread_init.patch

56 lines
3.4 KiB
Diff

commit 4ee00c7c664e2fb1a3ea7f9969b1f89c4ce1f6dc
Author: elupus <elupus@xbmc.org>
Date: Tue Nov 1 20:36:59 2011 +0100
Don't use depreciated avcodec_thread_init
diff --git a/lib/DllAvCodec.h b/lib/DllAvCodec.h
index 0802236..05edcb7 100644
--- a/lib/DllAvCodec.h
+++ b/lib/DllAvCodec.h
@@ -137,7 +137,6 @@ public:
virtual enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat *fmt)=0;
virtual int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic)=0;
virtual void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic)=0;
- virtual int avcodec_thread_init(AVCodecContext *s, int thread_count)=0;
virtual AVCodec *av_codec_next(AVCodec *c)=0;
virtual AVAudioConvert *av_audio_convert_alloc(enum AVSampleFormat out_fmt, int out_channels,
enum AVSampleFormat in_fmt , int in_channels,
@@ -225,7 +224,6 @@ public:
virtual int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic) { return ::avcodec_default_get_buffer(s, pic); }
virtual void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic) { ::avcodec_default_release_buffer(s, pic); }
virtual enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat *fmt) { return ::avcodec_default_get_format(s, fmt); }
- virtual int avcodec_thread_init(AVCodecContext *s, int thread_count) { return ::avcodec_thread_init(s, thread_count); }
virtual AVCodec *av_codec_next(AVCodec *c) { return ::av_codec_next(c); }
virtual AVAudioConvert *av_audio_convert_alloc(enum AVSampleFormat out_fmt, int out_channels,
enum AVSampleFormat in_fmt , int in_channels,
@@ -290,7 +288,6 @@ class DllAvCodec : public DllDynamic, DllAvCodecInterface
DEFINE_METHOD2(void, avcodec_default_release_buffer, (AVCodecContext *p1, AVFrame *p2))
DEFINE_METHOD2(enum PixelFormat, avcodec_default_get_format, (struct AVCodecContext *p1, const enum PixelFormat *p2))
- DEFINE_METHOD2(int, avcodec_thread_init, (AVCodecContext *p1, int p2))
DEFINE_METHOD1(AVCodec*, av_codec_next, (AVCodec *p1))
DEFINE_METHOD6(AVAudioConvert*, av_audio_convert_alloc, (enum AVSampleFormat p1, int p2,
enum AVSampleFormat p3, int p4,
@@ -328,7 +325,6 @@ class DllAvCodec : public DllDynamic, DllAvCodecInterface
RESOLVE_METHOD(avcodec_default_get_buffer)
RESOLVE_METHOD(avcodec_default_release_buffer)
RESOLVE_METHOD(avcodec_default_get_format)
- RESOLVE_METHOD(avcodec_thread_init)
RESOLVE_METHOD(av_codec_next)
RESOLVE_METHOD(av_audio_convert_alloc)
RESOLVE_METHOD(av_audio_convert_free)
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
index 9c8ff66..26bdb3a 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
@@ -279,7 +279,7 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options
if( num_threads > 1 && !hints.software && m_pHardware == NULL // thumbnail extraction fails when run threaded
&& ( pCodec->id == CODEC_ID_H264
|| pCodec->id == CODEC_ID_MPEG4 ))
- m_dllAvCodec.avcodec_thread_init(m_pCodecContext, num_threads);
+ m_pCodecContext->thread_count = num_threads;
if (m_dllAvCodec.avcodec_open(m_pCodecContext, pCodec) < 0)
{