summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-04-26 17:42:20 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-04-26 17:42:20 +0300
commit4785c2617ee9ac186464a55c1bfb13a5781ef041 (patch)
tree2424f18b68b2037bd4e290471821e9adae28b876 /libmpcodecs
parent2732d5efbae3e0ee28bc6b70ceab1eb77e593216 (diff)
parent38abe6ff7a3810f8e01b6296570e92df1b12b09c (diff)
downloadmpv-4785c2617ee9ac186464a55c1bfb13a5781ef041.tar.bz2
mpv-4785c2617ee9ac186464a55c1bfb13a5781ef041.tar.xz
Merge svn changes up to r30967
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/ad_realaud.c23
-rw-r--r--libmpcodecs/vd_hmblck.c7
-rw-r--r--libmpcodecs/vd_realvid.c5
-rw-r--r--libmpcodecs/vd_theora.c21
-rw-r--r--libmpcodecs/vd_xanim.c8
-rw-r--r--libmpcodecs/vf_gradfun.c6
6 files changed, 40 insertions, 30 deletions
diff --git a/libmpcodecs/ad_realaud.c b/libmpcodecs/ad_realaud.c
index dd8b2947ec..0b7fb219f7 100644
--- a/libmpcodecs/ad_realaud.c
+++ b/libmpcodecs/ad_realaud.c
@@ -26,6 +26,7 @@
#ifdef HAVE_LIBDL
#include <dlfcn.h>
#endif
+#include "path.h"
#include "ad_internal.h"
#include "loader/wine/windef.h"
@@ -220,9 +221,9 @@ static int preinit(sh_audio_t *sh){
unsigned int result;
char *path;
- path = malloc(strlen(BINARY_CODECS_PATH) + strlen(sh->codec->dll) + 2);
+ path = malloc(strlen(codec_path) + strlen(sh->codec->dll) + 2);
if (!path) return 0;
- sprintf(path, BINARY_CODECS_PATH "/%s", sh->codec->dll);
+ sprintf(path, "%s/%s", codec_path, sh->codec->dll);
/* first try to load linux dlls, if failed and we're supporting win32 dlls,
then try to load the windows ones */
@@ -246,8 +247,8 @@ static int preinit(sh_audio_t *sh){
if(raSetDLLAccessPath){
#endif
// used by 'SIPR'
- path = realloc(path, strlen(BINARY_CODECS_PATH) + 13);
- sprintf(path, "DT_Codecs=" BINARY_CODECS_PATH);
+ path = realloc(path, strlen(codec_path) + 13);
+ sprintf(path, "DT_Codecs=%s", codec_path);
if(path[strlen(path)-1]!='/'){
path[strlen(path)+1]=0;
path[strlen(path)]='/';
@@ -268,15 +269,17 @@ static int preinit(sh_audio_t *sh){
#ifdef CONFIG_WIN32DLL
if (dll_type == 1){
- if(wraOpenCodec2)
- result = wraOpenCodec2(&sh->context, BINARY_CODECS_PATH "\\");
- else
+ if (wraOpenCodec2) {
+ sprintf(path, "%s\\", codec_path);
+ result = wraOpenCodec2(&sh->context, path);
+ } else
result=wraOpenCodec(&sh->context);
} else
#endif
- if(raOpenCodec2)
- result = raOpenCodec2(&sh->context, BINARY_CODECS_PATH "/");
- else
+ if (raOpenCodec2) {
+ sprintf(path, "%s/", codec_path);
+ result = raOpenCodec2(&sh->context, path);
+ } else
result=raOpenCodec(&sh->context);
if(result){
mp_msg(MSGT_DECAUDIO,MSGL_WARN,"Decoder open failed, error code: 0x%X\n",result);
diff --git a/libmpcodecs/vd_hmblck.c b/libmpcodecs/vd_hmblck.c
index 81b1c4373b..a9a871cae2 100644
--- a/libmpcodecs/vd_hmblck.c
+++ b/libmpcodecs/vd_hmblck.c
@@ -24,8 +24,6 @@
#include "vd_internal.h"
-#define TEMP_BUF_SIZE (720*576)
-
static const vd_info_t info = {
"Hauppauge Macroblock/NV12/NV21 Decoder",
"hmblck",
@@ -92,11 +90,6 @@ static int nv12_to_yv12(unsigned char *data, int len, mp_image_t* mpi, int swapp
"hmblck: Image size inconsistent with data size.\n");
return 0;
}
- if ( (mpi->width > 720) || (mpi->height > 576) ) {
- mp_msg(MSGT_DECVIDEO,MSGL_ERR,
- "hmblck: Image size is too big.\n");
- return 0;
- }
if (mpi->num_planes != 3) {
mp_msg(MSGT_DECVIDEO,MSGL_ERR,
"hmblck: Incorrect number of image planes.\n");
diff --git a/libmpcodecs/vd_realvid.c b/libmpcodecs/vd_realvid.c
index be67210f88..5f4d7cb8a8 100644
--- a/libmpcodecs/vd_realvid.c
+++ b/libmpcodecs/vd_realvid.c
@@ -27,6 +27,7 @@
#include "mp_msg.h"
#include "mpbswap.h"
+#include "path.h"
#include "vd_internal.h"
#include "loader/wine/windef.h"
@@ -292,9 +293,9 @@ static int init(sh_video_t *sh){
mp_msg(MSGT_DECVIDEO,MSGL_V,"realvideo codec id: 0x%08X sub-id: 0x%08X\n",be2me_32(((unsigned int*)extrahdr)[1]),be2me_32(((unsigned int*)extrahdr)[0]));
- path = malloc(strlen(BINARY_CODECS_PATH) + strlen(sh->codec->dll) + 2);
+ path = malloc(strlen(codec_path) + strlen(sh->codec->dll) + 2);
if (!path) return 0;
- sprintf(path, BINARY_CODECS_PATH "/%s", sh->codec->dll);
+ sprintf(path, "%s/%s", codec_path, sh->codec->dll);
/* first try to load linux dlls, if failed and we're supporting win32 dlls,
then try to load the windows ones */
diff --git a/libmpcodecs/vd_theora.c b/libmpcodecs/vd_theora.c
index 1c69de6df8..ddf81fa5c7 100644
--- a/libmpcodecs/vd_theora.c
+++ b/libmpcodecs/vd_theora.c
@@ -26,6 +26,8 @@
#include "vd_internal.h"
+#include "ffmpeg_files/intreadwrite.h"
+
static const vd_info_t info = {
"Theora/VP3",
"theora",
@@ -74,6 +76,8 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){
*/
static int init(sh_video_t *sh){
theora_struct_t *context = NULL;
+ uint8_t *extradata = (uint8_t *)(sh->bih + 1);
+ int extradata_size = sh->bih->biSize - sizeof(*sh->bih);
int errorCode = 0;
ogg_packet op;
int i;
@@ -89,8 +93,21 @@ static int init(sh_video_t *sh){
/* Read all header packets, pass them to theora_decode_header. */
for (i = 0; i < THEORA_NUM_HEADER_PACKETS; i++)
{
- op.bytes = ds_get_packet (sh->ds, &op.packet);
- op.b_o_s = 1;
+ if (extradata_size > 2) {
+ op.bytes = AV_RB16(extradata);
+ op.packet = extradata + 2;
+ op.b_o_s = 1;
+ if (extradata_size < op.bytes + 2) {
+ mp_msg(MSGT_DECAUDIO, MSGL_ERR, "Theora header too small\n");
+ goto err_out;
+ }
+ extradata += op.bytes + 2;
+ extradata_size -= op.bytes + 2;
+ } else {
+ op.bytes = ds_get_packet (sh->ds, &op.packet);
+ op.b_o_s = 1;
+ }
+
if ( (errorCode = theora_decode_header (&context->inf, &context->cc, &op)) )
{
mp_msg(MSGT_DECAUDIO, MSGL_ERR, "Broken Theora header; errorCode=%i!\n", errorCode);
diff --git a/libmpcodecs/vd_xanim.c b/libmpcodecs/vd_xanim.c
index c756c8b8b7..da61f73245 100644
--- a/libmpcodecs/vd_xanim.c
+++ b/libmpcodecs/vd_xanim.c
@@ -29,7 +29,7 @@
#include <string.h> /* strerror */
#include "config.h"
-
+#include "path.h"
#include "mp_msg.h"
#include "vd_internal.h"
@@ -649,7 +649,6 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){
static int init(sh_video_t *sh)
{
vd_xanim_ctx *priv;
- char *def_path = BINARY_CODECS_PATH;
char dll[1024];
XA_CODEC_HDR codec_hdr;
int i;
@@ -668,10 +667,7 @@ static int init(sh_video_t *sh)
for (i=0; i < XA_CLOSE_FUNCS; i++)
xa_close_func[i] = NULL;
- if (getenv("XANIM_MOD_DIR"))
- def_path = getenv("XANIM_MOD_DIR");
-
- snprintf(dll, 1024, "%s/%s", def_path, sh->codec->dll);
+ snprintf(dll, 1024, "%s/%s", codec_path, sh->codec->dll);
if (xacodec_load(sh, dll) == 0)
return 0;
diff --git a/libmpcodecs/vf_gradfun.c b/libmpcodecs/vf_gradfun.c
index 66d921a4c1..f7495948e5 100644
--- a/libmpcodecs/vf_gradfun.c
+++ b/libmpcodecs/vf_gradfun.c
@@ -102,7 +102,7 @@ static void filter_line_mmx2(uint8_t *dst, uint8_t *src, uint16_t *dc,
width = x;
}
x = -width;
- asm volatile(
+ __asm__ volatile(
"movd %4, %%mm5 \n"
"pxor %%mm7, %%mm7 \n"
"pshufw $0, %%mm5, %%mm5 \n"
@@ -150,7 +150,7 @@ static void filter_line_ssse3(uint8_t *dst, uint8_t *src, uint16_t *dc,
width = x;
}
x = -width;
- asm volatile(
+ __asm__ volatile(
"movd %4, %%xmm5 \n"
"pxor %%xmm7, %%xmm7 \n"
"pshuflw $0,%%xmm5, %%xmm5 \n"
@@ -187,7 +187,7 @@ static void filter_line_ssse3(uint8_t *dst, uint8_t *src, uint16_t *dc,
#define BLURV(load)\
intptr_t x = -2*width;\
- asm volatile(\
+ __asm__ volatile(\
"movdqa %6, %%xmm7 \n"\
"1: \n"\
load" (%4,%0), %%xmm0 \n"\