void-packages/srcpkgs/xbmc/patches/120_all_av_set_params.patch

85 lines
4.7 KiB
Diff

commit 157206286d3a165f97c4d0ef67e70756d6b4f496
Author: Alexis Ballier <aballier@gentoo.org>
Date: Thu Mar 1 10:44:00 2012 -0300
Remove av_set_parameters.
It is gone in libavformat 54 and avformat_write_header takes care of allocating data as needed.
diff --git a/lib/DllAvFormat.h b/lib/DllAvFormat.h
index df946ee..0671fee 100644
--- a/lib/DllAvFormat.h
+++ b/lib/DllAvFormat.h
@@ -98,7 +98,6 @@ public:
virtual AVFormatContext *avformat_alloc_context(void)=0;
virtual AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c)=0;
virtual AVOutputFormat *av_guess_format(const char *short_name, const char *filename, const char *mime_type)=0;
- virtual int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap)=0;
virtual AVIOContext *av_alloc_put_byte(unsigned char *buffer, int buffer_size, int write_flag, void *opaque,
int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
@@ -162,7 +161,6 @@ public:
virtual AVFormatContext *avformat_alloc_context() { return ::avformat_alloc_context(); }
virtual AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c) { return ::avformat_new_stream(s, c); }
virtual AVOutputFormat *av_guess_format(const char *short_name, const char *filename, const char *mime_type) { return ::av_guess_format(short_name, filename, mime_type); }
- virtual int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap) { return ::av_set_parameters(s, ap); }
virtual AVIOContext *av_alloc_put_byte(unsigned char *buffer, int buffer_size, int write_flag, void *opaque,
int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
@@ -225,7 +223,6 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface
DEFINE_METHOD0(AVFormatContext *, avformat_alloc_context)
DEFINE_METHOD2(AVStream *, avformat_new_stream, (AVFormatContext *p1, AVCodec *p2))
DEFINE_METHOD3(AVOutputFormat *, av_guess_format, (const char *p1, const char *p2, const char *p3))
- DEFINE_METHOD2(int, av_set_parameters, (AVFormatContext *p1, AVFormatParameters *p2));
DEFINE_METHOD7(AVIOContext *, av_alloc_put_byte, (unsigned char *p1, int p2, int p3, void *p4,
int(*p5)(void *opaque, uint8_t *buf, int buf_size),
int(*p6)(void *opaque, uint8_t *buf, int buf_size),
@@ -268,7 +265,6 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface
RESOLVE_METHOD(avformat_alloc_context)
RESOLVE_METHOD(avformat_new_stream)
RESOLVE_METHOD(av_guess_format)
- RESOLVE_METHOD(av_set_parameters)
RESOLVE_METHOD(av_alloc_put_byte)
RESOLVE_METHOD(avformat_write_header)
RESOLVE_METHOD(av_write_trailer)
diff --git a/xbmc/cdrip/EncoderFFmpeg.cpp b/xbmc/cdrip/EncoderFFmpeg.cpp
index 13c9772..7959919 100644
--- a/xbmc/cdrip/EncoderFFmpeg.cpp
+++ b/xbmc/cdrip/EncoderFFmpeg.cpp
@@ -89,15 +89,6 @@ bool CEncoderFFmpeg::Init(const char* strFile, int iInChannels, int iInRate, int
m_Format->oformat = fmt;
m_Format->bit_rate = g_guiSettings.GetInt("audiocds.bitrate") * 1000;
- /* setup the muxer */
- if (m_dllAvFormat.av_set_parameters(m_Format, NULL) != 0)
- {
- m_dllAvUtil.av_freep(&m_Format->pb);
- m_dllAvUtil.av_freep(&m_Format);
- CLog::Log(LOGERROR, "CEncoderFFmpeg::Init - Failed to set the muxer parameters");
- return false;
- }
-
/* add a stream to it */
m_Stream = m_dllAvFormat.avformat_new_stream(m_Format, codec);
if (!m_Stream)
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp
index 4257f96..d230623 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp
@@ -112,15 +112,6 @@ bool CDVDAudioCodecPassthroughFFmpeg::SetupMuxer(CDVDStreamInfo &hints, CStdStri
muxer.m_pFormat->flags |= AVFMT_NOFILE | AVFMT_FLAG_IGNIDX;
muxer.m_pFormat->bit_rate = hints.bitrate;
- /* setup the muxer */
- if (m_dllAvFormat.av_set_parameters(muxer.m_pFormat, NULL) != 0)
- {
- CLog::Log(LOGERROR, "CDVDAudioCodecPassthroughFFmpeg::SetupMuxer - Failed to set the %s muxer parameters", muxerName.c_str());
- Dispose();
- return false;
- }
-
-
/* While this is strictly only needed on big-endian systems, we do it on
* both to avoid as much dead code as possible.
* CoreAudio (at least on the cases we've seen) wants IEC 61937 in