Mercurial > mplayer.hg
annotate libmpcodecs/vd_realvid.c @ 33040:a6be6a134ac0
Fix XVMC decoding (avcodec_open would fail if thread_count is set)
and simplify code a bit in the process.
author | reimar |
---|---|
date | Sun, 27 Mar 2011 13:09:27 +0000 |
parents | 8fa2f43cb760 |
children | 139f2b064ef9 |
rev | line source |
---|---|
30421
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
1 /* |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
2 * This file is part of MPlayer. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
3 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
4 * MPlayer is free software; you can redistribute it and/or modify |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
5 * it under the terms of the GNU General Public License as published by |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
6 * the Free Software Foundation; either version 2 of the License, or |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
7 * (at your option) any later version. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
8 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
9 * MPlayer is distributed in the hope that it will be useful, |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
12 * GNU General Public License for more details. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
13 * |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
14 * You should have received a copy of the GNU General Public License along |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
17 */ |
bbb6ebec87a0
Add missing license headers to all files in the libmpcodecs directory.
diego
parents:
29263
diff
changeset
|
18 |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
19 #include <stdio.h> |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
20 #include <stdlib.h> |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
21 |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
22 #include "config.h" |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
23 |
10093 | 24 #ifdef HAVE_LIBDL |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
25 #include <dlfcn.h> |
10093 | 26 #endif |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
27 |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
28 #include "mp_msg.h" |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
29 #include "help_mp.h" |
31617 | 30 #include "libavutil/intreadwrite.h" |
30906
a34f16fb8823
Real binary loader code should respect the binary codec path.
diego
parents:
30846
diff
changeset
|
31 #include "path.h" |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
32 |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
33 #include "vd_internal.h" |
22577
a033e5519802
Include loader/ prefix in #include path everywhere.
diego
parents:
21563
diff
changeset
|
34 #include "loader/wine/windef.h" |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
35 |
30504
cc27da5d7286
Mark all ad_info_t/vd_info_t structure declarations as const.
diego
parents:
30421
diff
changeset
|
36 static const vd_info_t info = { |
6404
83b3315c679b
Implement Nilmoni's and Bernd Ernesti's patches for:
atmos4
parents:
6361
diff
changeset
|
37 "RealVideo decoder", |
7174 | 38 "realvid", |
12628
985e1813e298
support for realvideo codecs under macosx, original patch by Donnie Smith
alex
parents:
12356
diff
changeset
|
39 "Alex Beregszaszi", |
985e1813e298
support for realvideo codecs under macosx, original patch by Donnie Smith
alex
parents:
12356
diff
changeset
|
40 "Florian Schneider, Arpad Gereoffy, Alex Beregszaszi, Donnie Smith", |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
41 "binary real video codecs" |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
42 }; |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
43 |
7174 | 44 LIBVD_EXTERN(realvid) |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
45 |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
46 |
8522 | 47 /* |
48 * Structures for data packets. These used to be tables of unsigned ints, but | |
49 * that does not work on 64 bit platforms (e.g. Alpha). The entries that are | |
50 * pointers get truncated. Pointers on 64 bit platforms are 8 byte longs. | |
51 * So we have to use structures so the compiler will assign the proper space | |
52 * for the pointer. | |
53 */ | |
54 typedef struct cmsg_data_s { | |
55 uint32_t data1; | |
56 uint32_t data2; | |
57 uint32_t* dimensions; | |
58 } cmsg_data_t; | |
59 | |
60 typedef struct transform_in_s { | |
61 uint32_t len; | |
62 uint32_t unknown1; | |
63 uint32_t chunks; | |
64 uint32_t* extra; | |
65 uint32_t unknown2; | |
66 uint32_t timestamp; | |
67 } transform_in_t; | |
68 | |
69 static unsigned long (*rvyuv_custom_message)(cmsg_data_t* ,void*); | |
7728 | 70 static unsigned long (*rvyuv_free)(void*); |
71 static unsigned long (*rvyuv_init)(void*, void*); // initdata,context | |
8522 | 72 static unsigned long (*rvyuv_transform)(char*, char*,transform_in_t*,unsigned int*,void*); |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26754
diff
changeset
|
73 #ifdef CONFIG_WIN32DLL |
8525 | 74 static unsigned long WINAPI (*wrvyuv_custom_message)(cmsg_data_t* ,void*); |
75 static unsigned long WINAPI (*wrvyuv_free)(void*); | |
76 static unsigned long WINAPI (*wrvyuv_init)(void*, void*); // initdata,context | |
77 static unsigned long WINAPI (*wrvyuv_transform)(char*, char*,transform_in_t*,unsigned int*,void*); | |
78 #endif | |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
79 |
7728 | 80 static void *rv_handle=NULL; |
25962 | 81 static int initialized=0; |
21559
de2a96f41195
Fix realvideo size changes by using our own malloced buffer and export type mpi.
reimar
parents:
21466
diff
changeset
|
82 static uint8_t *buffer = NULL; |
21563
c08b8066a1c6
Only increase buffer size to avoid crashes when seeking in
reimar
parents:
21559
diff
changeset
|
83 static int bufsz = 0; |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26754
diff
changeset
|
84 #ifdef CONFIG_WIN32DLL |
8525 | 85 static int dll_type = 0; /* 0 = unix dlopen, 1 = win32 dll */ |
86 #endif | |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
87 |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
88 // to set/get/query special features/parameters |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
89 static int control(sh_video_t *sh,int cmd,void* arg,...){ |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
90 // switch(cmd){ |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
91 // case VDCTRL_QUERY_MAX_PP_LEVEL: |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
92 // return 9; |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
93 // case VDCTRL_SET_PP_LEVEL: |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
94 // vfw_set_postproc(sh,10*(*((int*)arg))); |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
95 // return CONTROL_OK; |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
96 // } |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
97 return CONTROL_UNKNOWN; |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
98 } |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
99 |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
100 /* exits program when failure */ |
10093 | 101 #ifdef HAVE_LIBDL |
7728 | 102 static int load_syms_linux(char *path) { |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
103 void *handle; |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
104 |
17721
7b336a5585e4
Reduce Real DLL/so loading verbosity, OKed by Roberto.
diego
parents:
17012
diff
changeset
|
105 mp_msg(MSGT_DECVIDEO,MSGL_V, "opening shared obj '%s'\n", path); |
9386 | 106 handle = dlopen (path, RTLD_LAZY); |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
107 if (!handle) { |
6361 | 108 mp_msg(MSGT_DECVIDEO,MSGL_WARN,"Error: %s\n",dlerror()); |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
109 return 0; |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
110 } |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
111 |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
112 rvyuv_custom_message = dlsym(handle, "RV20toYUV420CustomMessage"); |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
113 rvyuv_free = dlsym(handle, "RV20toYUV420Free"); |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
114 rvyuv_init = dlsym(handle, "RV20toYUV420Init"); |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
115 rvyuv_transform = dlsym(handle, "RV20toYUV420Transform"); |
6361 | 116 |
117 if(rvyuv_custom_message && | |
118 rvyuv_free && | |
119 rvyuv_init && | |
9386 | 120 rvyuv_transform) |
121 { | |
122 rv_handle = handle; | |
123 return 1; | |
124 } | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28468
diff
changeset
|
125 |
13860
d6f716fdd734
remove mac shlb support to use new helix codec for realvideo support on osx
nplourde
parents:
12628
diff
changeset
|
126 rvyuv_custom_message = dlsym(handle, "RV40toYUV420CustomMessage"); |
d6f716fdd734
remove mac shlb support to use new helix codec for realvideo support on osx
nplourde
parents:
12628
diff
changeset
|
127 rvyuv_free = dlsym(handle, "RV40toYUV420Free"); |
d6f716fdd734
remove mac shlb support to use new helix codec for realvideo support on osx
nplourde
parents:
12628
diff
changeset
|
128 rvyuv_init = dlsym(handle, "RV40toYUV420Init"); |
d6f716fdd734
remove mac shlb support to use new helix codec for realvideo support on osx
nplourde
parents:
12628
diff
changeset
|
129 rvyuv_transform = dlsym(handle, "RV40toYUV420Transform"); |
d6f716fdd734
remove mac shlb support to use new helix codec for realvideo support on osx
nplourde
parents:
12628
diff
changeset
|
130 |
d6f716fdd734
remove mac shlb support to use new helix codec for realvideo support on osx
nplourde
parents:
12628
diff
changeset
|
131 if(rvyuv_custom_message && |
d6f716fdd734
remove mac shlb support to use new helix codec for realvideo support on osx
nplourde
parents:
12628
diff
changeset
|
132 rvyuv_free && |
d6f716fdd734
remove mac shlb support to use new helix codec for realvideo support on osx
nplourde
parents:
12628
diff
changeset
|
133 rvyuv_init && |
d6f716fdd734
remove mac shlb support to use new helix codec for realvideo support on osx
nplourde
parents:
12628
diff
changeset
|
134 rvyuv_transform) |
d6f716fdd734
remove mac shlb support to use new helix codec for realvideo support on osx
nplourde
parents:
12628
diff
changeset
|
135 { |
d6f716fdd734
remove mac shlb support to use new helix codec for realvideo support on osx
nplourde
parents:
12628
diff
changeset
|
136 rv_handle = handle; |
d6f716fdd734
remove mac shlb support to use new helix codec for realvideo support on osx
nplourde
parents:
12628
diff
changeset
|
137 return 1; |
d6f716fdd734
remove mac shlb support to use new helix codec for realvideo support on osx
nplourde
parents:
12628
diff
changeset
|
138 } |
6361 | 139 |
140 mp_msg(MSGT_DECVIDEO,MSGL_WARN,"Error resolving symbols! (version incompatibility?)\n"); | |
9386 | 141 dlclose(handle); |
6361 | 142 return 0; |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
143 } |
10093 | 144 #endif |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
145 |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26754
diff
changeset
|
146 #ifdef CONFIG_WIN32DLL |
7127 | 147 |
10093 | 148 #ifdef WIN32_LOADER |
17012 | 149 #include "loader/ldt_keeper.h" |
10093 | 150 #endif |
8525 | 151 void* WINAPI LoadLibraryA(char* name); |
152 void* WINAPI GetProcAddress(void* handle,char* func); | |
153 int WINAPI FreeLibrary(void *handle); | |
7127 | 154 |
24087
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
155 #ifndef WIN32_LOADER |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
156 void * WINAPI GetModuleHandleA(char *); |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
157 static int patch_dll(uint8_t *patchpos, const uint8_t *oldcode, |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
158 const uint8_t *newcode, int codesize) { |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
159 void *handle = GetModuleHandleA("kernel32"); |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
160 int WINAPI (*VirtProt)(void *, unsigned, int, int *); |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
161 int res = 0; |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
162 int prot, tmp; |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
163 VirtProt = GetProcAddress(handle, "VirtualProtect"); |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
164 // change permissions to PAGE_WRITECOPY |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
165 if (!VirtProt || |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
166 !VirtProt(patchpos, codesize, 0x08, &prot)) { |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
167 mp_msg(MSGT_DECVIDEO, MSGL_WARN, "VirtualProtect failed at %p\n", patchpos); |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
168 return 0; |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
169 } |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
170 if (memcmp(patchpos, oldcode, codesize) == 0) { |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
171 memcpy(patchpos, newcode, codesize); |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
172 res = 1; |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
173 } |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
174 VirtProt(patchpos, codesize, prot, &tmp); |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
175 return res; |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
176 } |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
177 #endif |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
178 |
7728 | 179 static int load_syms_windows(char *path) { |
6360 | 180 void *handle; |
8525 | 181 |
17721
7b336a5585e4
Reduce Real DLL/so loading verbosity, OKed by Roberto.
diego
parents:
17012
diff
changeset
|
182 mp_msg(MSGT_DECVIDEO,MSGL_V, "opening win32 dll '%s'\n", path); |
10093 | 183 #ifdef WIN32_LOADER |
6360 | 184 Setup_LDT_Keeper(); |
10093 | 185 #endif |
9386 | 186 handle = LoadLibraryA(path); |
6361 | 187 mp_msg(MSGT_DECVIDEO,MSGL_V,"win32 real codec handle=%p \n",handle); |
8525 | 188 if (!handle) { |
189 mp_msg(MSGT_DECVIDEO,MSGL_WARN,"Error loading dll\n"); | |
190 return 0; | |
191 } | |
6360 | 192 |
8525 | 193 wrvyuv_custom_message = GetProcAddress(handle, "RV20toYUV420CustomMessage"); |
194 wrvyuv_free = GetProcAddress(handle, "RV20toYUV420Free"); | |
195 wrvyuv_init = GetProcAddress(handle, "RV20toYUV420Init"); | |
196 wrvyuv_transform = GetProcAddress(handle, "RV20toYUV420Transform"); | |
9386 | 197 |
8525 | 198 if(wrvyuv_custom_message && |
199 wrvyuv_free && | |
200 wrvyuv_init && | |
9386 | 201 wrvyuv_transform) |
202 { | |
203 dll_type = 1; | |
204 rv_handle = handle; | |
24087
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
205 #ifndef WIN32_LOADER |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
206 { |
26389
b65cf3a35900
Oops...should be "drv43260.dll" instead of "drv34260.dll"
zuxy
parents:
26388
diff
changeset
|
207 if (strstr(path, "drv43260.dll")) { |
26385
3d02fa79ae6c
Don't print "Could not patch" messages when we haven't actually tried to patch.
zuxy
parents:
26384
diff
changeset
|
208 int patched; |
24087
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
209 // patch away multithreaded decoding, it causes crashes |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
210 static const uint8_t oldcode[13] = { |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
211 0x83, 0xbb, 0xf8, 0x05, 0x00, 0x00, 0x01, |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
212 0x0f, 0x86, 0xd0, 0x00, 0x00, 0x00 }; |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
213 static const uint8_t newcode[13] = { |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
214 0x31, 0xc0, |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
215 0x89, 0x83, 0xf8, 0x05, 0x00, 0x00, |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
216 0xe9, 0xd0, 0x00, 0x00, 0x00 }; |
26388 | 217 patched = patch_dll( |
218 (char*)wrvyuv_transform + 0x634132fa - 0x634114d0, | |
219 oldcode, newcode, sizeof(oldcode)); | |
26386 | 220 if (!patched) |
221 mp_msg(MSGT_DECVIDEO, MSGL_WARN, "Could not patch Real codec, this might crash on multi-CPU systems\n"); | |
26385
3d02fa79ae6c
Don't print "Could not patch" messages when we haven't actually tried to patch.
zuxy
parents:
26384
diff
changeset
|
222 } |
24087
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
223 } |
5992f8a979e3
Runtime-patching for windows to fix crash with drv43260.dll
reimar
parents:
22577
diff
changeset
|
224 #endif |
9386 | 225 return 1; |
226 } | |
26384 | 227 |
228 wrvyuv_custom_message = GetProcAddress(handle, "RV40toYUV420CustomMessage"); | |
229 wrvyuv_free = GetProcAddress(handle, "RV40toYUV420Free"); | |
230 wrvyuv_init = GetProcAddress(handle, "RV40toYUV420Init"); | |
231 wrvyuv_transform = GetProcAddress(handle, "RV40toYUV420Transform"); | |
232 if(wrvyuv_custom_message && | |
233 wrvyuv_free && | |
234 wrvyuv_init && | |
26398 | 235 wrvyuv_transform) { |
236 dll_type = 1; | |
237 rv_handle = handle; | |
26384 | 238 return 1; |
26398 | 239 } |
26384 | 240 |
8525 | 241 mp_msg(MSGT_DECVIDEO,MSGL_WARN,"Error resolving symbols! (version incompatibility?)\n"); |
9386 | 242 FreeLibrary(handle); |
6360 | 243 return 0; // error |
244 } | |
245 #endif | |
246 | |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
247 /* we need exact positions */ |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
248 struct rv_init_t { |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
249 short unk1; |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
250 short w; |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
251 short h; |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
252 short unk3; |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
253 int unk2; |
6345 | 254 int subformat; |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
255 int unk5; |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
256 int format; |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
257 } rv_init_t; |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
258 |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
259 // init driver |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
260 static int init(sh_video_t *sh){ |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
261 //unsigned int out_fmt; |
10102 | 262 char *path; |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
263 int result; |
6345 | 264 // we export codec id and sub-id from demuxer in bitmapinfohdr: |
20920 | 265 unsigned char* extrahdr=(unsigned char*)(sh->bih+1); |
32105 | 266 unsigned int extrahdr_size = sh->bih->biSize - sizeof(*sh->bih); |
20920 | 267 struct rv_init_t init_data; |
6345 | 268 |
20920 | 269 if(extrahdr_size < 8) { |
32105 | 270 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"realvideo: extradata too small (%u)\n", extrahdr_size); |
20920 | 271 return 0; |
272 } | |
31614
b40d593a463f
Use AV_RL* macros instead of typecasts where appropriate.
reimar
parents:
30908
diff
changeset
|
273 init_data = (struct rv_init_t){11, sh->disp_w, sh->disp_h, 0, 0, AV_RB32(extrahdr), 1, AV_RB32(extrahdr + 4)}; // rv30 |
20920 | 274 |
31617 | 275 mp_msg(MSGT_DECVIDEO,MSGL_V,"realvideo codec id: 0x%08X sub-id: 0x%08X\n",init_data.format,init_data.subformat); |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
276 |
30908 | 277 path = malloc(strlen(codec_path) + strlen(sh->codec->dll) + 2); |
10102 | 278 if (!path) return 0; |
30908 | 279 sprintf(path, "%s/%s", codec_path, sh->codec->dll); |
6543
70a9c9f695a2
first try to load linux dlls, if failed and we're supporting win32 dlls, then try to load the windows ones
alex
parents:
6404
diff
changeset
|
280 |
70a9c9f695a2
first try to load linux dlls, if failed and we're supporting win32 dlls, then try to load the windows ones
alex
parents:
6404
diff
changeset
|
281 /* first try to load linux dlls, if failed and we're supporting win32 dlls, |
70a9c9f695a2
first try to load linux dlls, if failed and we're supporting win32 dlls, then try to load the windows ones
alex
parents:
6404
diff
changeset
|
282 then try to load the windows ones */ |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28468
diff
changeset
|
283 #ifdef HAVE_LIBDL |
10093 | 284 if(strstr(sh->codec->dll,".dll") || !load_syms_linux(path)) |
285 #endif | |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26754
diff
changeset
|
286 #ifdef CONFIG_WIN32DLL |
10444 | 287 if (!load_syms_windows(sh->codec->dll)) |
6543
70a9c9f695a2
first try to load linux dlls, if failed and we're supporting win32 dlls, then try to load the windows ones
alex
parents:
6404
diff
changeset
|
288 #endif |
70a9c9f695a2
first try to load linux dlls, if failed and we're supporting win32 dlls, then try to load the windows ones
alex
parents:
6404
diff
changeset
|
289 { |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
290 mp_msg(MSGT_DECVIDEO,MSGL_ERR,MSGTR_MissingDLLcodec,sh->codec->dll); |
9386 | 291 mp_msg(MSGT_DECVIDEO,MSGL_HINT,"Read the RealVideo section of the DOCS!\n"); |
10102 | 292 free(path); |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
293 return 0; |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
294 } |
10102 | 295 free(path); |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
296 // only I420 supported |
9552
86b5ea6396ab
Ugly hack to handle bad width/height values from stream header
arpi
parents:
9386
diff
changeset
|
297 // if((sh->format!=0x30335652) && !mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_I420)) return 0; |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
298 // init codec: |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
299 sh->context=NULL; |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26754
diff
changeset
|
300 #ifdef CONFIG_WIN32DLL |
8525 | 301 if (dll_type == 1) |
302 result=(*wrvyuv_init)(&init_data, &sh->context); | |
303 else | |
304 #endif | |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
305 result=(*rvyuv_init)(&init_data, &sh->context); |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
306 if (result){ |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
307 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Couldn't open RealVideo codec, error code: 0x%X \n",result); |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
308 return 0; |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
309 } |
6345 | 310 // setup rv30 codec (codec sub-type and image dimensions): |
31617 | 311 if((sh->format<=0x30335652) && AV_RB32(extrahdr + 4)>=0x20200002){ |
20920 | 312 int i, cmsg_cnt; |
313 uint32_t cmsg24[16]={sh->disp_w,sh->disp_h}; | |
314 cmsg_data_t cmsg_data={0x24,1+(extrahdr[1]&7), &cmsg24[0]}; | |
315 | |
316 mp_msg(MSGT_DECVIDEO,MSGL_V,"realvideo: using cmsg24 with %u elements.\n",extrahdr[1]&7); | |
317 cmsg_cnt = (extrahdr[1]&7)*2; | |
318 if (extrahdr_size-8 < cmsg_cnt) { | |
319 mp_msg(MSGT_DECVIDEO,MSGL_WARN,"realvideo: not enough extradata (%u) to make %u cmsg24 elements.\n",extrahdr_size-8,extrahdr[1]&7); | |
320 cmsg_cnt = extrahdr_size-8; | |
321 } | |
322 for (i = 0; i < cmsg_cnt; i++) | |
323 cmsg24[2+i] = extrahdr[8+i]*4; | |
324 if (extrahdr_size-8 > cmsg_cnt) | |
325 mp_msg(MSGT_DECVIDEO,MSGL_WARN,"realvideo: %u bytes of unknown extradata remaining.\n",extrahdr_size-8-cmsg_cnt); | |
8525 | 326 |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26754
diff
changeset
|
327 #ifdef CONFIG_WIN32DLL |
8525 | 328 if (dll_type == 1) |
329 (*wrvyuv_custom_message)(&cmsg_data,sh->context); | |
330 else | |
331 #endif | |
8522 | 332 (*rvyuv_custom_message)(&cmsg_data,sh->context); |
6345 | 333 } |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
334 mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: RealVideo codec init OK!\n"); |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
335 return 1; |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
336 } |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
337 |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
338 // uninit driver |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
339 static void uninit(sh_video_t *sh){ |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26754
diff
changeset
|
340 #ifdef CONFIG_WIN32DLL |
8525 | 341 if (dll_type == 1) |
342 { | |
343 if (wrvyuv_free) wrvyuv_free(sh->context); | |
344 } else | |
345 #endif | |
7728 | 346 if(rvyuv_free) rvyuv_free(sh->context); |
8525 | 347 |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26754
diff
changeset
|
348 #ifdef CONFIG_WIN32DLL |
8525 | 349 if (dll_type == 1) |
350 { | |
351 if (rv_handle) FreeLibrary(rv_handle); | |
352 } else | |
353 #endif | |
10093 | 354 #ifdef HAVE_LIBDL |
6345 | 355 if(rv_handle) dlclose(rv_handle); |
10093 | 356 #endif |
6345 | 357 rv_handle=NULL; |
25962 | 358 initialized = 0; |
32537
8fa2f43cb760
Remove most of the NULL pointer check before free all over the code
cboesch
parents:
32105
diff
changeset
|
359 free(buffer); |
21559
de2a96f41195
Fix realvideo size changes by using our own malloced buffer and export type mpi.
reimar
parents:
21466
diff
changeset
|
360 buffer = NULL; |
21563
c08b8066a1c6
Only increase buffer size to avoid crashes when seeking in
reimar
parents:
21559
diff
changeset
|
361 bufsz = 0; |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
362 } |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
363 |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
364 // decode a frame |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
365 static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
366 mp_image_t* mpi; |
6745
9734bfbb200a
Avoid ulong typedef clash and replace if by unsigned long, patch by Joey Parrish.
atmos4
parents:
6544
diff
changeset
|
367 unsigned long result; |
28468
b9da026ee222
change internal real video packetizing format to the more straight forward one
aurel
parents:
27341
diff
changeset
|
368 uint8_t *buf = data; |
b9da026ee222
change internal real video packetizing format to the more straight forward one
aurel
parents:
27341
diff
changeset
|
369 int chunks = *buf++; |
b9da026ee222
change internal real video packetizing format to the more straight forward one
aurel
parents:
27341
diff
changeset
|
370 int extra_size = 8*(chunks+1); |
b9da026ee222
change internal real video packetizing format to the more straight forward one
aurel
parents:
27341
diff
changeset
|
371 uint32_t data_size = len-1-extra_size; |
b9da026ee222
change internal real video packetizing format to the more straight forward one
aurel
parents:
27341
diff
changeset
|
372 unsigned char* dp_data=buf+extra_size; |
b9da026ee222
change internal real video packetizing format to the more straight forward one
aurel
parents:
27341
diff
changeset
|
373 uint32_t* extra=(uint32_t*)buf; |
b9da026ee222
change internal real video packetizing format to the more straight forward one
aurel
parents:
27341
diff
changeset
|
374 int i; |
7082 | 375 |
8522 | 376 unsigned int transform_out[5]; |
377 transform_in_t transform_in={ | |
28468
b9da026ee222
change internal real video packetizing format to the more straight forward one
aurel
parents:
27341
diff
changeset
|
378 data_size, // length of the packet (sub-packets appended) |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
379 0, // unknown, seems to be unused |
28468
b9da026ee222
change internal real video packetizing format to the more straight forward one
aurel
parents:
27341
diff
changeset
|
380 chunks, // number of sub-packets - 1 |
8522 | 381 extra, // table of sub-packet offsets |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
382 0, // unknown, seems to be unused |
25598 | 383 0, // timestamp (should be unneded) |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
384 }; |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
385 |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
386 if(len<=0 || flags&2) return NULL; // skipped frame || hardframedrop |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
387 |
21563
c08b8066a1c6
Only increase buffer size to avoid crashes when seeking in
reimar
parents:
21559
diff
changeset
|
388 if (bufsz < sh->disp_w*sh->disp_h*3/2) { |
32537
8fa2f43cb760
Remove most of the NULL pointer check before free all over the code
cboesch
parents:
32105
diff
changeset
|
389 free(buffer); |
21563
c08b8066a1c6
Only increase buffer size to avoid crashes when seeking in
reimar
parents:
21559
diff
changeset
|
390 bufsz = sh->disp_w*sh->disp_h*3/2; |
c08b8066a1c6
Only increase buffer size to avoid crashes when seeking in
reimar
parents:
21559
diff
changeset
|
391 buffer=malloc(bufsz); |
9552
86b5ea6396ab
Ugly hack to handle bad width/height values from stream header
arpi
parents:
9386
diff
changeset
|
392 if (!buffer) return 0; |
86b5ea6396ab
Ugly hack to handle bad width/height values from stream header
arpi
parents:
9386
diff
changeset
|
393 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28468
diff
changeset
|
394 |
28468
b9da026ee222
change internal real video packetizing format to the more straight forward one
aurel
parents:
27341
diff
changeset
|
395 for (i=0; i<2*(chunks+1); i++) |
31623
4d4ed6c9039c
Fix some remaining bswap-related compilation issues.
reimar
parents:
31617
diff
changeset
|
396 extra[i] = av_le2ne32(extra[i]); |
28468
b9da026ee222
change internal real video packetizing format to the more straight forward one
aurel
parents:
27341
diff
changeset
|
397 |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26754
diff
changeset
|
398 #ifdef CONFIG_WIN32DLL |
8525 | 399 if (dll_type == 1) |
9552
86b5ea6396ab
Ugly hack to handle bad width/height values from stream header
arpi
parents:
9386
diff
changeset
|
400 result=(*wrvyuv_transform)(dp_data, buffer, &transform_in, |
8525 | 401 transform_out, sh->context); |
402 else | |
403 #endif | |
9552
86b5ea6396ab
Ugly hack to handle bad width/height values from stream header
arpi
parents:
9386
diff
changeset
|
404 result=(*rvyuv_transform)(dp_data, buffer, &transform_in, |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
405 transform_out, sh->context); |
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
406 |
25962 | 407 if(!initialized){ // rv30 width/height now known |
9552
86b5ea6396ab
Ugly hack to handle bad width/height values from stream header
arpi
parents:
9386
diff
changeset
|
408 sh->aspect=(float)sh->disp_w/(float)sh->disp_h; |
86b5ea6396ab
Ugly hack to handle bad width/height values from stream header
arpi
parents:
9386
diff
changeset
|
409 sh->disp_w=transform_out[3]; |
86b5ea6396ab
Ugly hack to handle bad width/height values from stream header
arpi
parents:
9386
diff
changeset
|
410 sh->disp_h=transform_out[4]; |
86b5ea6396ab
Ugly hack to handle bad width/height values from stream header
arpi
parents:
9386
diff
changeset
|
411 if (!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_I420)) return 0; |
25962 | 412 initialized=1; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28468
diff
changeset
|
413 } |
21559
de2a96f41195
Fix realvideo size changes by using our own malloced buffer and export type mpi.
reimar
parents:
21466
diff
changeset
|
414 mpi=mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, 0 /*MP_IMGFLAG_ACCEPT_STRIDE*/, |
9552
86b5ea6396ab
Ugly hack to handle bad width/height values from stream header
arpi
parents:
9386
diff
changeset
|
415 sh->disp_w, sh->disp_h); |
86b5ea6396ab
Ugly hack to handle bad width/height values from stream header
arpi
parents:
9386
diff
changeset
|
416 if(!mpi) return NULL; |
21559
de2a96f41195
Fix realvideo size changes by using our own malloced buffer and export type mpi.
reimar
parents:
21466
diff
changeset
|
417 mpi->planes[0] = buffer; |
de2a96f41195
Fix realvideo size changes by using our own malloced buffer and export type mpi.
reimar
parents:
21466
diff
changeset
|
418 mpi->stride[0] = sh->disp_w; |
de2a96f41195
Fix realvideo size changes by using our own malloced buffer and export type mpi.
reimar
parents:
21466
diff
changeset
|
419 mpi->planes[1] = buffer + sh->disp_w*sh->disp_h; |
de2a96f41195
Fix realvideo size changes by using our own malloced buffer and export type mpi.
reimar
parents:
21466
diff
changeset
|
420 mpi->stride[1] = sh->disp_w / 2; |
de2a96f41195
Fix realvideo size changes by using our own malloced buffer and export type mpi.
reimar
parents:
21466
diff
changeset
|
421 mpi->planes[2] = buffer + sh->disp_w*sh->disp_h*5/4; |
de2a96f41195
Fix realvideo size changes by using our own malloced buffer and export type mpi.
reimar
parents:
21466
diff
changeset
|
422 mpi->stride[2] = sh->disp_w / 2; |
9552
86b5ea6396ab
Ugly hack to handle bad width/height values from stream header
arpi
parents:
9386
diff
changeset
|
423 |
21559
de2a96f41195
Fix realvideo size changes by using our own malloced buffer and export type mpi.
reimar
parents:
21466
diff
changeset
|
424 if(transform_out[0] && |
de2a96f41195
Fix realvideo size changes by using our own malloced buffer and export type mpi.
reimar
parents:
21466
diff
changeset
|
425 (sh->disp_w != transform_out[3] || sh->disp_h != transform_out[4])) |
25962 | 426 initialized = 0; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28468
diff
changeset
|
427 |
26754
63630c09e237
cosmetics: Remove pointless parentheses from return calls.
diego
parents:
26398
diff
changeset
|
428 return result ? NULL : mpi; |
6341
d79c52610702
RealVideo rv30 decoder, using binary driver from realplayer8
arpi
parents:
diff
changeset
|
429 } |