commit 4caa26437aa24253cb97032a46d7c51581b6d5f7 Author: Alexis Ballier Date: Thu Mar 1 12:57:40 2012 -0300 Use av_opt_set instead of av_set_string3 and drop support for old API. diff --git a/lib/DllAvUtil.h b/lib/DllAvUtil.h index 0a293f9..f498c7c 100644 --- a/lib/DllAvUtil.h +++ b/lib/DllAvUtil.h @@ -90,7 +90,7 @@ public: virtual int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)=0; virtual const AVCRC* av_crc_get_table(AVCRCId crc_id)=0; virtual uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length)=0; - virtual int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out)=0; + virtual int av_opt_set(void *obj, const char *name, const char *val, int search_flags)=0; virtual AVFifoBuffer *av_fifo_alloc(unsigned int size) = 0; virtual void av_fifo_free(AVFifoBuffer *f) = 0; virtual void av_fifo_reset(AVFifoBuffer *f) = 0; @@ -121,12 +121,7 @@ public: virtual int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) { return ::av_rescale_q(a, bq, cq); } virtual const AVCRC* av_crc_get_table(AVCRCId crc_id) { return ::av_crc_get_table(crc_id); } virtual uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length) { return ::av_crc(ctx, crc, buffer, length); } -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52,7,0) - // API added on: 2008-12-16 - virtual int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out) { return ::av_set_string3(obj, name, val, alloc, o_out); } -#else - virtual int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out) { return AVERROR(ENOENT); } -#endif + virtual int av_opt_set(void *obj, const char *name, const char *val, int search_flags) { return ::av_opt_set(obj, name, val, search_flags); } virtual AVFifoBuffer *av_fifo_alloc(unsigned int size) {return ::av_fifo_alloc(size); } virtual void av_fifo_free(AVFifoBuffer *f) { ::av_fifo_free(f); } virtual void av_fifo_reset(AVFifoBuffer *f) { ::av_fifo_reset(f); } @@ -168,7 +163,7 @@ class DllAvUtilBase : public DllDynamic, DllAvUtilInterface DEFINE_METHOD3(int64_t, av_rescale_q, (int64_t p1, AVRational p2, AVRational p3)); DEFINE_METHOD1(const AVCRC*, av_crc_get_table, (AVCRCId p1)) DEFINE_METHOD4(uint32_t, av_crc, (const AVCRC *p1, uint32_t p2, const uint8_t *p3, size_t p4)); - DEFINE_METHOD5(int, av_set_string3, (void *p1, const char *p2, const char *p3, int p4, const AVOption **p5)); + DEFINE_METHOD4(int, av_opt_set, (void *p1, const char *p2, const char *p3, int p4)); DEFINE_METHOD1(AVFifoBuffer*, av_fifo_alloc, (unsigned int p1)) DEFINE_METHOD1(void, av_fifo_free, (AVFifoBuffer *p1)) DEFINE_METHOD1(void, av_fifo_reset, (AVFifoBuffer *p1)) @@ -192,7 +187,7 @@ class DllAvUtilBase : public DllDynamic, DllAvUtilInterface RESOLVE_METHOD(av_rescale_q) RESOLVE_METHOD(av_crc_get_table) RESOLVE_METHOD(av_crc) - RESOLVE_METHOD(av_set_string3) + RESOLVE_METHOD(av_opt_set) RESOLVE_METHOD(av_fifo_alloc) RESOLVE_METHOD(av_fifo_free) RESOLVE_METHOD(av_fifo_reset) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp index fbd6264..c0c3c06 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp @@ -123,7 +123,7 @@ bool CDVDAudioCodecPassthroughFFmpeg::SetupMuxer(CDVDStreamInfo &hints, CStdStri #endif /* request output of wanted endianness */ - if (!fOut->priv_class || m_dllAvUtil.av_set_string3(muxer.m_pFormat->priv_data, "spdif_flags", spdifFlags, 0, NULL) != 0) + if (!fOut->priv_class || m_dllAvUtil.av_opt_set(muxer.m_pFormat->priv_data, "spdif_flags", spdifFlags, 0) != 0) { #if defined(WORDS_BIGENDIAN) && !defined(__APPLE__) CLog::Log(LOGERROR, "CDVDAudioCodecPassthroughFFmpeg::SetupMuxer - Unable to set big-endian stream mode (FFmpeg too old?), disabling passthrough"); diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp index bd115b9..33bb3b7 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -277,7 +277,7 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options if (it->m_name == "surfaces") m_uSurfacesCount = std::atoi(it->m_value.c_str()); else - m_dllAvUtil.av_set_string3(m_pCodecContext, it->m_name.c_str(), it->m_value.c_str(), 0, NULL); + m_dllAvUtil.av_opt_set(m_pCodecContext, it->m_name.c_str(), it->m_value.c_str(), 0); } int num_threads = std::min(8 /*MAX_THREADS*/, g_cpuInfo.getCPUCount());