/[packages]/cauldron/xbmc/current/SOURCES/0005-changed-replace-deprecated-use-of-CODEC_TYPE_-defini.patch
ViewVC logotype

Contents of /cauldron/xbmc/current/SOURCES/0005-changed-replace-deprecated-use-of-CODEC_TYPE_-defini.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 162472 - (show annotations) (download)
Thu Nov 3 18:58:48 2011 UTC (12 years, 5 months ago) by anssi
File size: 5488 byte(s)
- fix build with current FFmpeg
  o 12 patches backported from upstream git master
    (including 4 previously committed but non-submitted patches (SILENT)
     re-backported with proper names) (SILENT)
  o xbmc-pvr-new-ffmpeg.patch
- build with libpng12 instead of libpng (fixes build)
- renumber patches
- fix grammar of a .spec comment
- build with external FFmpeg (SILENT, reverts non-submitted commit)

1 From c3b77dc6d580061ca9ffad1591ae802021d76947 Mon Sep 17 00:00:00 2001
2 From: Anssi Hannula <anssi@xbmc.org>
3 Date: Wed, 2 Feb 2011 02:24:55 +0200
4 Subject: [PATCH 05/12] changed: replace deprecated use of CODEC_TYPE_
5 definitions
6
7 (cherry-picked from a0ff26e7737466241339305eeaa935c359703412)
8 ---
9 xbmc/cdrip/EncoderFFmpeg.cpp | 2 +-
10 xbmc/cores/dvdplayer/Codecs/DllAvCodec.h | 12 ++++++++++++
11 .../Audio/DVDAudioCodecPassthroughFFmpeg.cpp | 2 +-
12 .../cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 14 +++++++-------
13 4 files changed, 21 insertions(+), 9 deletions(-)
14
15 diff --git a/xbmc/cdrip/EncoderFFmpeg.cpp b/xbmc/cdrip/EncoderFFmpeg.cpp
16 index 981c8d9..4f5f6c3 100644
17 --- a/xbmc/cdrip/EncoderFFmpeg.cpp
18 +++ b/xbmc/cdrip/EncoderFFmpeg.cpp
19 @@ -121,7 +121,7 @@ bool CEncoderFFmpeg::Init(const char* strFile, int iInChannels, int iInRate, int
20 /* set the stream's parameters */
21 m_CodecCtx = m_Stream->codec;
22 m_CodecCtx->codec_id = codec->id;
23 - m_CodecCtx->codec_type = CODEC_TYPE_AUDIO;
24 + m_CodecCtx->codec_type = AVMEDIA_TYPE_AUDIO;
25 m_CodecCtx->bit_rate = m_Format->bit_rate;
26 m_CodecCtx->sample_rate = iInRate;
27 m_CodecCtx->channels = iInChannels;
28 diff --git a/xbmc/cores/dvdplayer/Codecs/DllAvCodec.h b/xbmc/cores/dvdplayer/Codecs/DllAvCodec.h
29 index c4c11d6..3b11c41 100644
30 --- a/xbmc/cores/dvdplayer/Codecs/DllAvCodec.h
31 +++ b/xbmc/cores/dvdplayer/Codecs/DllAvCodec.h
32 @@ -77,6 +77,18 @@ extern "C" {
33
34 #include "utils/SingleLock.h"
35
36 +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52,64,0)
37 +// API added on: 2010-03-31
38 +#define AVMediaType CodecType
39 +#define AVMEDIA_TYPE_UNKNOWN CODEC_TYPE_UNKNOWN
40 +#define AVMEDIA_TYPE_VIDEO CODEC_TYPE_VIDEO
41 +#define AVMEDIA_TYPE_AUDIO CODEC_TYPE_AUDIO
42 +#define AVMEDIA_TYPE_DATA CODEC_TYPE_DATA
43 +#define AVMEDIA_TYPE_SUBTITLE CODEC_TYPE_SUBTITLE
44 +#define AVMEDIA_TYPE_ATTACHMENT CODEC_TYPE_ATTACHMENT
45 +#define AVMEDIA_TYPE_NB CODEC_TYPE_NB
46 +#endif
47 +
48 class DllAvCodecInterface
49 {
50 public:
51 diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp
52 index eed1e6a..b43b44e 100644
53 --- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp
54 +++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp
55 @@ -146,7 +146,7 @@ bool CDVDAudioCodecPassthroughFFmpeg::SetupMuxer(CDVDStreamInfo &hints, CStdStri
56 m_SampleRate = 48000;
57
58 AVCodecContext *codec = muxer.m_pStream->codec;
59 - codec->codec_type = CODEC_TYPE_AUDIO;
60 + codec->codec_type = AVMEDIA_TYPE_AUDIO;
61 codec->codec_id = hints.codec;
62 codec->sample_rate = m_SampleRate;
63 codec->sample_fmt = AV_SAMPLE_FMT_S16;
64 diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
65 index 769550f..33e0a59 100644
66 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
67 +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
68 @@ -730,7 +730,7 @@ DemuxPacket* CDVDDemuxFFmpeg::Read()
69 if(pkt.pts == 0)
70 pkt.pts = AV_NOPTS_VALUE;
71
72 - if(m_bMatroska && stream->codec && stream->codec->codec_type == CODEC_TYPE_VIDEO)
73 + if(m_bMatroska && stream->codec && stream->codec->codec_type == AVMEDIA_TYPE_VIDEO)
74 { // matroska can store different timestamps
75 // for different formats, for native stored
76 // stuff it is pts, but for ms compatibility
77 @@ -747,7 +747,7 @@ DemuxPacket* CDVDDemuxFFmpeg::Read()
78 if(m_bMatroska && stream->codec->codec_id == CODEC_ID_TEXT && pkt.convergence_duration != 0)
79 pkt.duration = pkt.convergence_duration;
80
81 - if(m_bAVI && stream->codec && stream->codec->codec_type == CODEC_TYPE_VIDEO)
82 + if(m_bAVI && stream->codec && stream->codec->codec_type == AVMEDIA_TYPE_VIDEO)
83 {
84 // AVI's always have borked pts, specially if m_pFormatContext->flags includes
85 // AVFMT_FLAG_GENPTS so always use dts
86 @@ -970,7 +970,7 @@ void CDVDDemuxFFmpeg::AddStream(int iId)
87
88 switch (pStream->codec->codec_type)
89 {
90 - case CODEC_TYPE_AUDIO:
91 + case AVMEDIA_TYPE_AUDIO:
92 {
93 CDemuxStreamAudioFFmpeg* st = new CDemuxStreamAudioFFmpeg(this, pStream);
94 m_streams[iId] = st;
95 @@ -985,7 +985,7 @@ void CDVDDemuxFFmpeg::AddStream(int iId)
96
97 break;
98 }
99 - case CODEC_TYPE_VIDEO:
100 + case AVMEDIA_TYPE_VIDEO:
101 {
102 CDemuxStreamVideoFFmpeg* st = new CDemuxStreamVideoFFmpeg(this, pStream);
103 m_streams[iId] = st;
104 @@ -1039,13 +1039,13 @@ void CDVDDemuxFFmpeg::AddStream(int iId)
105 }
106 break;
107 }
108 - case CODEC_TYPE_DATA:
109 + case AVMEDIA_TYPE_DATA:
110 {
111 m_streams[iId] = new CDemuxStream();
112 m_streams[iId]->type = STREAM_DATA;
113 break;
114 }
115 - case CODEC_TYPE_SUBTITLE:
116 + case AVMEDIA_TYPE_SUBTITLE:
117 {
118 #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52,38,1)
119 if (pStream->codec->codec_id == CODEC_ID_DVB_TELETEXT && g_guiSettings.GetBool("videoplayer.teletextenabled"))
120 @@ -1069,7 +1069,7 @@ void CDVDDemuxFFmpeg::AddStream(int iId)
121 break;
122 }
123 }
124 - case CODEC_TYPE_ATTACHMENT:
125 + case AVMEDIA_TYPE_ATTACHMENT:
126 { //mkv attachments. Only bothering with fonts for now.
127 if(pStream->codec->codec_id == CODEC_ID_TTF)
128 {
129 --
130 1.7.4.4
131

  ViewVC Help
Powered by ViewVC 1.1.30