View | Details | Raw Unified | Return to bug 185227
Collapse All | Expand All

(-)./osg/Makefile (-3 / +7 lines)
Lines 2-17 Link Here
2
# $FreeBSD: head/graphics/osg/Makefile 334422 2013-11-20 14:25:28Z nemysis $
2
# $FreeBSD: head/graphics/osg/Makefile 334422 2013-11-20 14:25:28Z nemysis $
3
3
4
PORTNAME=	osg
4
PORTNAME=	osg
5
PORTVERSION=	3.0.1
5
PORTVERSION=	3.2.0
6
PORTREVISION=	8
7
CATEGORIES=	graphics
6
CATEGORIES=	graphics
8
MASTER_SITES=	http://www.openscenegraph.org/downloads/stable_releases/OpenSceneGraph-${PORTVERSION}/source/ \
7
MASTER_SITES=	http://trac.openscenegraph.org/downloads/developer_releases/ \
9
		http://mirror.amdmi3.ru/distfiles/
8
		http://mirror.amdmi3.ru/distfiles/
10
DISTNAME=	OpenSceneGraph-${PORTVERSION}
9
DISTNAME=	OpenSceneGraph-${PORTVERSION}
11
10
12
MAINTAINER=	amdmi3@FreeBSD.org
11
MAINTAINER=	amdmi3@FreeBSD.org
13
COMMENT=	C++ OpenGL scene graph library for real-time rendering
12
COMMENT=	C++ OpenGL scene graph library for real-time rendering
14
13
14
LICENSE=	OSGPL
15
LICENSE_NAME=	OpenSceneGraph Public License
16
LICENSE_FILE=	${WRKSRC}/LICENSE.txt
17
LICENSE_PERMS=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
18
15
LIB_DEPENDS=	libjpeg.so:${PORTSDIR}/graphics/jpeg \
19
LIB_DEPENDS=	libjpeg.so:${PORTSDIR}/graphics/jpeg \
16
		libpng.so:${PORTSDIR}/graphics/png \
20
		libpng.so:${PORTSDIR}/graphics/png \
17
		libtiff.so:${PORTSDIR}/graphics/tiff
21
		libtiff.so:${PORTSDIR}/graphics/tiff
(-)./osg/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (OpenSceneGraph-3.0.1.zip) = 0c1103574b0a5a27c7d68d43454f1bf9c0cea114a583c42637bc8eb47b1d8296
1
SHA256 (OpenSceneGraph-3.2.0.zip) = ceca56e58e9ba245d5f9d0661352ddf405a7cb105341a122c5541b69c0ce032e
2
SIZE (OpenSceneGraph-3.0.1.zip) = 6780282
2
SIZE (OpenSceneGraph-3.2.0.zip) = 7195748
(-)./osg/files/patch-include-OpenThreads-Atomic (-11 lines)
Lines 1-11 Link Here
1
--- include/OpenThreads/Atomic.orig	2011-01-31 12:35:50.000000000 +0100
2
+++ include/OpenThreads/Atomic	2013-09-18 12:41:22.000000000 +0200
3
@@ -241,7 +241,7 @@
4
 AtomicPtr::assign(void* ptrNew, const void* const ptrOld)
5
 {
6
 #if defined(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)
7
-    return __sync_bool_compare_and_swap(&_ptr, ptrOld, ptrNew);
8
+    return __sync_bool_compare_and_swap(&_ptr, (void *)ptrOld, ptrNew);
9
 #elif defined(_OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS)
10
     return __compare_and_swap((unsigned long*)&_ptr, (unsigned long)ptrOld, (unsigned long)ptrNew);
11
 #elif defined(_OPENTHREADS_ATOMIC_USE_SUN)
(-)./osg/files/patch-include-osg-Math (-29 lines)
Lines 1-29 Link Here
1
--- include/osg/Math.orig	2011-05-26 20:52:08.000000000 +0400
2
+++ include/osg/Math	2013-09-24 22:00:59.252519925 +0400
3
@@ -20,7 +20,7 @@
4
 
5
 //certain math functions were not defined until 10.2
6
 //so this code checks the version so it can add in workarounds for older versions.
7
-#ifdef __APPLE__
8
+#if defined(__APPLE__)
9
 // Using std::isnan will work for OS X, but use of <cmath> 
10
 // and std:: are not necessarily portible with other systems so 
11
 // the include of <cmath> is isolated here.
12
@@ -38,6 +38,8 @@
13
         #define APPLE_PRE_10_2
14
     #endif
15
 #endif
16
+#elif defined(__FreeBSD__)
17
+#include <cmath>
18
 #endif
19
 
20
 #if defined(_MSC_VER)
21
@@ -207,7 +209,7 @@
22
     inline bool isNaN(float v) { return _isnan(v)!=0; }
23
     inline bool isNaN(double v) { return _isnan(v)!=0; }
24
 #else
25
-    #if defined(__APPLE__)
26
+    #if defined(__APPLE__) || defined(__FreeBSD__)
27
         inline bool isNaN(float v) { return std::isnan(v); }
28
         inline bool isNaN(double v) { return std::isnan(v); }
29
     #else
(-)./osg/files/patch-libav07 (-22 lines)
Lines 1-22 Link Here
1
diff -ruN src/osgPlugins/ffmpeg/FFmpegHeaders.hpp src/osgPlugins/ffmpeg/FFmpegHeaders.hpp
2
--- src/osgPlugins/ffmpeg/FFmpegHeaders.hpp	2011-06-17 10:41:56.000000000 +0200
3
+++ src/osgPlugins/ffmpeg/FFmpegHeaders.hpp	2011-11-17 19:44:33.194607494 +0100
4
@@ -9,12 +9,13 @@
5
 #define FF_API_OLD_SAMPLE_FMT 0
6
 #include <errno.h>    // for error codes defined in avformat.h
7
 #include <stdint.h>
8
-#include <avcodec.h>
9
-#include <avformat.h>
10
-#include <avdevice.h>
11
+#include <libavcodec/avcodec.h>
12
+#include <libavformat/avformat.h>
13
+#include <libavdevice/avdevice.h>
14
+#include <libavutil/mathematics.h>
15
 
16
-#ifdef USE_SWSCALE    
17
-    #include <swscale.h>
18
+#ifdef USE_SWSCALE
19
+    #include <libswscale/swscale.h>
20
 #endif
21
 
22
 }
(-)./osg/files/patch-libav9 (-284 lines)
Lines 1-284 Link Here
1
Patch by lu_zero
2
https://bugs.gentoo.org/show_bug.cgi?id=439606
3
upstream svn rev. 13335 contains similar changes.
4
no need to upstream this patch.
5
6
diff -burN CMakeModules/FindFFmpeg.cmake CMakeModules/FindFFmpeg.cmake
7
--- CMakeModules/FindFFmpeg.cmake	2011-04-19 13:40:22.000000000 +0200
8
+++ CMakeModules/FindFFmpeg.cmake	2012-11-22 13:59:28.303401170 +0100
9
@@ -131,20 +131,16 @@
10
     SET(FFMPEG_FOUND "YES")
11
 
12
     SET(FFMPEG_INCLUDE_DIRS
13
-        ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS} ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}/libavformat
14
-        ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS} ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS}/libavdevice
15
-        ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS} ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}/libavcodec
16
-        ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS} ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}/libavutil
17
+        ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}
18
+        ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS}
19
+        ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}
20
+        ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}
21
     )
22
 
23
     IF (FFMPEG_STDINT_INCLUDE_DIR)
24
         SET(FFMPEG_INCLUDE_DIRS
25
             ${FFMPEG_INCLUDE_DIRS}
26
             ${FFMPEG_STDINT_INCLUDE_DIR}
27
-            ${FFMPEG_STDINT_INCLUDE_DIR}/libavformat
28
-            ${FFMPEG_STDINT_INCLUDE_DIR}/libavdevice
29
-            ${FFMPEG_STDINT_INCLUDE_DIR}/libavcodec
30
-            ${FFMPEG_STDINT_INCLUDE_DIR}/libavutil
31
         )
32
     ENDIF()
33
 
34
diff -burN src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp
35
--- src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp	2011-04-19 13:40:22.000000000 +0200
36
+++ src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp	2012-11-22 15:03:53.668601596 +0100
37
@@ -89,7 +89,7 @@
38
         //    m_context->flags |= CODEC_FLAG_TRUNCATED;
39
 
40
         // Open codec
41
-        if (avcodec_open(m_context, p_codec) < 0)
42
+        if (avcodec_open2(m_context, p_codec, NULL) < 0)
43
             throw std::runtime_error("avcodec_open() failed");
44
     }
45
 
46
Binary files src/osgPlugins/ffmpeg/.FFmpegDecoderAudio.cpp.swp and src/osgPlugins/ffmpeg/.FFmpegDecoderAudio.cpp.swp differ
47
diff -burN src/osgPlugins/ffmpeg/FFmpegDecoder.cpp src/osgPlugins/ffmpeg/FFmpegDecoder.cpp
48
--- src/osgPlugins/ffmpeg/FFmpegDecoder.cpp	2011-07-15 12:25:12.000000000 +0200
49
+++ src/osgPlugins/ffmpeg/FFmpegDecoder.cpp	2012-11-22 15:59:39.569775078 +0100
50
@@ -64,21 +64,12 @@
51
         
52
             OSG_NOTICE<<"Attempting to stream "<<filename<<std::endl;
53
 
54
-            AVFormatParameters formatParams;
55
-            memset(&formatParams, 0, sizeof(AVFormatParameters));
56
             AVInputFormat *iformat;
57
+            AVDictionary *options = NULL;
58
 
59
-            formatParams.channel = 0;
60
-            formatParams.standard = 0;
61
-#if 1
62
-            formatParams.width = 320;
63
-            formatParams.height = 240;
64
-#else
65
-            formatParams.width = 640;
66
-            formatParams.height = 480;
67
-#endif            
68
-            formatParams.time_base.num = 1;
69
-            formatParams.time_base.den = 30;
70
+            av_dict_set(&options, "video_size", "320x240", 0);
71
+
72
+            av_dict_set(&options, "framerate", "1/30", 0);
73
 
74
             std::string format = "video4linux2";
75
             iformat = av_find_input_format(format.c_str());
76
@@ -92,7 +83,7 @@
77
                 OSG_NOTICE<<"Failed to find input format: "<<format<<std::endl;
78
             }
79
 
80
-            int error = av_open_input_file(&p_format_context, filename.c_str(), iformat, 0, &formatParams);
81
+            int error = avformat_open_input(&p_format_context, filename.c_str(), iformat, &options);
82
             if (error != 0)
83
             {
84
                 std::string error_str;
85
@@ -110,21 +101,21 @@
86
                     default: error_str = "Unknown error"; break;
87
                 }
88
 
89
-                throw std::runtime_error("av_open_input_file() failed : " + error_str);
90
+                throw std::runtime_error("avformat_open_input() failed : " + error_str);
91
             }
92
         }
93
         else
94
         {
95
             AVInputFormat* av_format = (parameters ? parameters->getFormat() : 0);
96
-            AVFormatParameters* av_params = (parameters ? parameters->getFormatParameter() : 0);
97
-            if (av_open_input_file(&p_format_context, filename.c_str(), av_format, 0, av_params) !=0 )
98
+            AVDictionary* av_options = (parameters ? parameters->getOptions() : NULL);
99
+            if (avformat_open_input(&p_format_context, filename.c_str(), av_format, &av_options) !=0 )
100
                 throw std::runtime_error("av_open_input_file() failed");
101
         }
102
         
103
         m_format_context.reset(p_format_context);
104
 
105
         // Retrieve stream info
106
-        if (av_find_stream_info(p_format_context) < 0)
107
+        if (avformat_find_stream_info(p_format_context, NULL) < 0)
108
             throw std::runtime_error("av_find_stream_info() failed");
109
 
110
         m_duration = double(m_format_context->duration) / AV_TIME_BASE;
111
@@ -134,7 +125,7 @@
112
         m_clocks.reset(m_start);
113
 
114
         // Dump info to stderr
115
-        dump_format(p_format_context, 0, filename.c_str(), false);
116
+        av_dump_format(p_format_context, 0, filename.c_str(), false);
117
 
118
         // Find and open the first video and audio streams (note that audio stream is optional and only opened if possible)
119
 
120
@@ -292,7 +283,7 @@
121
         // Read the next frame packet
122
         if (av_read_frame(m_format_context.get(), &packet) < 0)
123
         {
124
-            if (url_ferror(m_format_context->pb) == 0)
125
+            if (m_format_context->pb->eof_reached == 0)
126
                 end_of_stream = true;
127
             else
128
                 throw std::runtime_error("av_read_frame() failed");
129
Binary files src/osgPlugins/ffmpeg/.FFmpegDecoder.cpp.swp and src/osgPlugins/ffmpeg/.FFmpegDecoder.cpp.swp differ
130
diff -burN src/osgPlugins/ffmpeg/FFmpegDecoder.hpp src/osgPlugins/ffmpeg/FFmpegDecoder.hpp
131
--- src/osgPlugins/ffmpeg/FFmpegDecoder.hpp	2011-04-19 13:40:22.000000000 +0200
132
+++ src/osgPlugins/ffmpeg/FFmpegDecoder.hpp	2012-11-22 15:59:18.895774005 +0100
133
@@ -46,8 +46,8 @@
134
         {
135
             if (_ptr) 
136
             {
137
-                OSG_NOTICE<<"Calling av_close_input_file("<<_ptr<<")"<<std::endl;
138
-                av_close_input_file(_ptr);
139
+                OSG_NOTICE<<"Calling avformat_close_input("<<_ptr<<")"<<std::endl;
140
+                avformat_close_input(&_ptr);
141
             }
142
             _ptr = 0;
143
         }
144
@@ -151,8 +151,7 @@
145
 
146
 inline double FFmpegDecoder::creation_time() const
147
 {
148
-   if(m_format_context) return m_format_context->timestamp;
149
-   else return HUGE_VAL;
150
+    return HUGE_VAL;
151
 }
152
 
153
 inline double FFmpegDecoder::duration() const
154
diff -burN src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp
155
--- src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp	2011-04-19 13:40:22.000000000 +0200
156
+++ src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp	2012-11-22 16:01:30.906780849 +0100
157
@@ -83,7 +83,7 @@
158
     m_context = stream->codec;
159
 
160
     // Trust the video size given at this point
161
-    // (avcodec_open seems to sometimes return a 0x0 size)
162
+    // (avcodec_open2 seems to sometimes return a 0x0 size)
163
     m_width = m_context->width;
164
     m_height = m_context->height;
165
     findAspectRatio();
166
@@ -105,8 +105,8 @@
167
     //    m_context->flags |= CODEC_FLAG_TRUNCATED;
168
 
169
     // Open codec
170
-    if (avcodec_open(m_context, m_codec) < 0)
171
-        throw std::runtime_error("avcodec_open() failed");
172
+    if (avcodec_open2(m_context, m_codec, NULL) < 0)
173
+        throw std::runtime_error("avcodec_open2() failed");
174
 
175
     // Allocate video frame
176
     m_frame.reset(avcodec_alloc_frame());
177
Binary files src/osgPlugins/ffmpeg/.FFmpegDecoderVideo.cpp.swp and src/osgPlugins/ffmpeg/.FFmpegDecoderVideo.cpp.swp differ
178
diff -burN src/osgPlugins/ffmpeg/FFmpegParameters.cpp src/osgPlugins/ffmpeg/FFmpegParameters.cpp
179
--- src/osgPlugins/ffmpeg/FFmpegParameters.cpp	2011-07-15 12:25:12.000000000 +0200
180
+++ src/osgPlugins/ffmpeg/FFmpegParameters.cpp	2012-11-22 17:20:09.019025477 +0100
181
@@ -8,7 +8,7 @@
182
 #if LIBAVCODEC_VERSION_MAJOR >= 53
183
 extern "C"
184
 {
185
-    #include <parseutils.h>
186
+    #include <libavutil/parseutils.h>
187
 }
188
 #define av_parse_video_frame_size av_parse_video_size
189
 #define av_parse_video_frame_rate av_parse_video_rate
190
@@ -19,7 +19,7 @@
191
 
192
     extern "C"
193
     {
194
-        #include <pixdesc.h>
195
+        #include <libavutil/pixdesc.h>
196
     }
197
     
198
     inline PixelFormat osg_av_get_pix_fmt(const char *name) { return av_get_pix_fmt(name); }
199
@@ -34,14 +34,15 @@
200
 
201
 
202
 FFmpegParameters::FFmpegParameters() :
203
-    m_format(0)
204
-{
205
-    memset(&m_parameters, 0, sizeof(m_parameters));
206
-}
207
+    m_format(0),
208
+    m_options(NULL)
209
+{}
210
 
211
 
212
 FFmpegParameters::~FFmpegParameters()
213
-{}
214
+{
215
+    av_dict_free(&m_options);
216
+}
217
 
218
 
219
 void FFmpegParameters::parse(const std::string& name, const std::string& value)
220
@@ -59,40 +60,19 @@
221
     }
222
     else if (name == "pixel_format")
223
     {
224
-        m_parameters.pix_fmt = osg_av_get_pix_fmt(value.c_str());
225
+        av_dict_set(&m_options, "pixel_format", value.c_str(), 0);
226
     }
227
     else if (name == "frame_size")
228
     {
229
-        int frame_width = 0, frame_height = 0;
230
-        if (av_parse_video_frame_size(&frame_width, &frame_height, value.c_str()) < 0)
231
-        {
232
-            OSG_NOTICE<<"Failed to apply frame size: "<<value.c_str()<<std::endl;
233
-            return;
234
-        }
235
-        if ((frame_width % 2) != 0 || (frame_height % 2) != 0)
236
-        {
237
-            OSG_NOTICE<<"Frame size must be a multiple of 2: "<<frame_width<<"x"<<frame_height<<std::endl;
238
-            return;
239
-        }
240
-        m_parameters.width = frame_width;
241
-        m_parameters.height = frame_height;
242
+        av_dict_set(&m_options, "video_size", value.c_str(), 0);
243
     }
244
     else if (name == "frame_rate")
245
     {
246
-        AVRational frame_rate;
247
-        if (av_parse_video_frame_rate(&frame_rate, value.c_str()) < 0)
248
-        {
249
-            OSG_NOTICE<<"Failed to apply frame rate: "<<value.c_str()<<std::endl;
250
-            return;
251
-        }
252
-        m_parameters.time_base.den = frame_rate.num;
253
-        m_parameters.time_base.num = frame_rate.den;
254
+        av_dict_set(&m_options, "framerate", value.c_str(), 0);
255
     }
256
     else if (name == "audio_sample_rate")
257
     {
258
-        int audio_sample_rate = 44100;
259
-        std::stringstream ss(value); ss >> audio_sample_rate;
260
-        m_parameters.sample_rate = audio_sample_rate;
261
+        av_dict_set(&m_options, "sample_rate", value.c_str(), 0);
262
     }
263
 }
264
 
265
diff -burN src/osgPlugins/ffmpeg/FFmpegParameters.hpp src/osgPlugins/ffmpeg/FFmpegParameters.hpp
266
--- src/osgPlugins/ffmpeg/FFmpegParameters.hpp	2011-04-19 13:40:22.000000000 +0200
267
+++ src/osgPlugins/ffmpeg/FFmpegParameters.hpp	2012-11-22 15:23:27.490662455 +0100
268
@@ -21,14 +21,14 @@
269
     bool isFormatAvailable() const { return m_format!=NULL; }
270
     
271
     AVInputFormat* getFormat() { return m_format; }
272
-    AVFormatParameters* getFormatParameter() { return &m_parameters; }
273
+    AVDictionary* getOptions() { return m_options; }
274
     
275
     void parse(const std::string& name, const std::string& value);
276
 
277
 protected:
278
 
279
     AVInputFormat* m_format;
280
-    AVFormatParameters m_parameters;
281
+    AVDictionary* m_options;
282
 };
283
 
284
 
(-)./osg/files/patch-src-OpenThreads-common-Atomic.cpp (-11 lines)
Lines 1-11 Link Here
1
--- src/OpenThreads/common/Atomic.cpp.orig	2011-04-19 13:40:22.000000000 +0200
2
+++ src/OpenThreads/common/Atomic.cpp	2013-09-18 11:26:03.000000000 +0200
3
@@ -143,7 +143,7 @@
4
 AtomicPtr::assign(void* ptrNew, const void* const ptrOld)
5
 {
6
 #if defined(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)
7
-    return __sync_bool_compare_and_swap(&_ptr, ptrOld, ptrNew);
8
+    return __sync_bool_compare_and_swap(&_ptr, (void *)ptrOld, ptrNew);
9
 #elif defined(_OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
10
     return ptrOld == InterlockedCompareExchangePointer((PVOID volatile*)&_ptr, (PVOID)ptrNew, (PVOID)ptrOld);
11
 #elif defined(_OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
(-)./osg/files/patch-src-osgPlugins-ffmpeg-FFmpegDecoderAudio.cpp (-11 lines)
Lines 1-11 Link Here
1
--- src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp.orig	2013-10-28 13:22:11.997950234 -0200
2
+++ src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp	2013-10-28 13:22:39.838945189 -0200
3
@@ -9,6 +9,8 @@
4
 //#include <iostream>
5
 
6
 
7
+#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
8
+
9
 
10
 namespace osgFFmpeg {
11
 
(-)./osg/files/patch-src-osgPlugins-xine-video__out__rgb.c (-98 lines)
Lines 1-98 Link Here
1
--- src/osgPlugins/xine/video_out_rgb.c.orig
2
+++ src/osgPlugins/xine/video_out_rgb.c
3
@@ -51,6 +51,11 @@
4
 #include "xine/video_out.h"
5
 #include "video_out_rgb.h"
6
 
7
+#if !(XINE_MAJOR_VERSION < 1 || (XINE_MAJOR_VERSION == 1 && XINE_MINOR_VERSION < 2))
8
+#define round round_not
9
+#include <libavutil/mem.h>
10
+#undef round
11
+#endif
12
 
13
 #define THIS  "video_out_rgb"
14
 
15
@@ -2235,9 +2240,15 @@ rgbout_frame_dispose(vo_frame_t* vo_fram
16
 
17
 	EVAL(vo_frame != NULL)
18
 
19
+#if XINE_MAJOR_VERSION < 1 || (XINE_MAJOR_VERSION == 1 && XINE_MINOR_VERSION < 2)
20
 	release(frame->chunk[0]);
21
 	release(frame->chunk[1]);
22
 	release(frame->chunk[2]);
23
+#else
24
+	av_freep(frame->chunk[0]);
25
+	av_freep(frame->chunk[1]);
26
+	av_freep(frame->chunk[2]);
27
+#endif
28
 	free(frame);
29
 
30
 FAILURE:
31
@@ -2301,9 +2312,15 @@ rgbout_update_frame_format(vo_driver_t* 
32
 	this->frame_width      = frame->width;
33
 	this->frame_height     = frame->height;
34
 
35
+#if XINE_MAJOR_VERSION < 1 || (XINE_MAJOR_VERSION == 1 && XINE_MINOR_VERSION < 2)
36
 	release(frame->chunk[0]);
37
 	release(frame->chunk[1]);
38
 	release(frame->chunk[2]);
39
+#else
40
+	av_freep(frame->chunk[0]);
41
+	av_freep(frame->chunk[1]);
42
+	av_freep(frame->chunk[2]);
43
+#endif
44
 
45
 CHECK_FRAME:
46
 	switch(frame->format)
47
@@ -2320,6 +2337,7 @@ CHECK_FRAME:
48
 			frame->vo_frame.pitches[0] = (frame->width > 7) ? frame->width : 8;
49
 			frame->vo_frame.pitches[1] = (frame->width > 15) ? (frame->width >> 1) : 8;
50
 			frame->vo_frame.pitches[2] = frame->vo_frame.pitches[1];
51
+#if XINE_MAJOR_VERSION < 1 || (XINE_MAJOR_VERSION == 1 && XINE_MINOR_VERSION < 2)
52
 			frame->vo_frame.base[0] = (uint8_t*) xine_xmalloc_aligned(16,
53
 							 	frame->vo_frame.pitches[0] * frame->height,
54
 							 	&(frame->chunk[0]));
55
@@ -2329,6 +2347,14 @@ CHECK_FRAME:
56
 			frame->vo_frame.base[2] = (uint8_t*) xine_xmalloc_aligned(16,
57
 								frame->vo_frame.pitches[2] * (frame->height >> 1),
58
 								&(frame->chunk[2]));
59
+#else
60
+			frame->vo_frame.base[0] = (uint8_t*)(frame->chunk[0] =
61
+				av_mallocz(frame->vo_frame.pitches[0] * frame->height));
62
+			frame->vo_frame.base[1] = (uint8_t*)(frame->chunk[1] =
63
+				av_mallocz(frame->vo_frame.pitches[1] * (frame->height >> 1)));
64
+			frame->vo_frame.base[2] = (uint8_t*)(frame->chunk[2] =
65
+				av_mallocz(frame->vo_frame.pitches[2] * (frame->height >> 1)));
66
+#endif
67
 		}
68
 		break;
69
 
70
@@ -2344,9 +2370,14 @@ CHECK_FRAME:
71
 			frame->vo_frame.pitches[0] = (frame->width > 3) ? (frame->width << 1) : 8;
72
 			frame->vo_frame.pitches[1] = 0;
73
 			frame->vo_frame.pitches[2] = 0;
74
+#if XINE_MAJOR_VERSION < 1 || (XINE_MAJOR_VERSION == 1 && XINE_MINOR_VERSION < 2)
75
 			frame->vo_frame.base[0] = (uint8_t*) xine_xmalloc_aligned(16,
76
 								frame->vo_frame.pitches[0] * frame->height,
77
 								&(frame->chunk[0]));
78
+#else
79
+			frame->vo_frame.base[0] = (uint8_t*)(frame->chunk[0] =
80
+				av_mallocz(frame->vo_frame.pitches[0] * frame->height));
81
+#endif
82
 			frame->vo_frame.base[1] = NULL;
83
 			frame->vo_frame.base[2] = NULL;
84
 		}
85
@@ -2767,8 +2798,13 @@ init_class(xine_t* xine, void* vo_visual
86
 	clear(rgb_class, sizeof(rgbout_class_t));
87
 
88
 	rgb_class->driver_class.open_plugin     = open_plugin;
89
+#if XINE_MAJOR_VERSION < 1 || (XINE_MAJOR_VERSION == 1 && XINE_MINOR_VERSION < 2)
90
 	rgb_class->driver_class.get_identifier  = get_identifier;
91
 	rgb_class->driver_class.get_description = get_description;
92
+#else
93
+	rgb_class->driver_class.identifier      = get_identifier(NULL);
94
+	rgb_class->driver_class.description     = get_description(NULL);
95
+#endif
96
 	rgb_class->driver_class.dispose         = dispose_class;
97
 
98
 	return(rgb_class);

Return to bug 185227