From b769ea34ea539ba49d48b409ec8de358e3cf2c0f Mon Sep 17 00:00:00 2001 From: ramiro Date: Wed, 16 Sep 2009 22:31:43 +0000 Subject: Use correct buffers in vertical scaler in unscaled YV12 case. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29685 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_template.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index 48eda805cc..ad07bf7e5d 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -2770,9 +2770,9 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s alpSrcPtr, (uint16_t *) dest, (uint16_t *) uDest, (uint16_t *) vDest, (uint16_t *) aDest, dstW, chrDstW, dstFormat); } else if (vLumFilterSize == 1 && vChrFilterSize == 1) { // unscaled YV12 - int16_t *lumBuf = lumPixBuf[0]; - int16_t *chrBuf= chrPixBuf[0]; - int16_t *alpBuf= (CONFIG_SWSCALE_ALPHA && alpPixBuf) ? alpPixBuf[0] : NULL; + int16_t *lumBuf = lumSrcPtr[0]; + int16_t *chrBuf= chrSrcPtr[0]; + int16_t *alpBuf= (CONFIG_SWSCALE_ALPHA && alpPixBuf) ? alpSrcPtr[0] : NULL; c->yuv2yuv1(c, lumBuf, chrBuf, alpBuf, dest, uDest, vDest, aDest, dstW, chrDstW); } else { //General YV12 c->yuv2yuvX(c, -- cgit v1.2.3 From d41ec8ed48821c0796ef04dfa2b54d8ffe7a1919 Mon Sep 17 00:00:00 2001 From: ramiro Date: Wed, 16 Sep 2009 22:34:48 +0000 Subject: Cleanup buffer debugs in swScale(). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29686 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_template.c | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index ad07bf7e5d..27faf49d35 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -2529,6 +2529,9 @@ inline static void RENAME(hcscale)(SwsContext *c, uint16_t *dst, long dstWidth, } } +#define DEBUG_SWSCALE_BUFFERS 0 +#define DEBUG_BUFFERS(...) if (DEBUG_SWSCALE_BUFFERS) av_log(c, AV_LOG_DEBUG, __VA_ARGS__) + static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t* dst[], int dstStride[]) { @@ -2589,11 +2592,13 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s srcStride[1]<<= c->vChrDrop; srcStride[2]<<= c->vChrDrop; - //printf("swscale %X %X %X -> %X %X %X\n", (int)src[0], (int)src[1], (int)src[2], - // (int)dst[0], (int)dst[1], (int)dst[2]); - - //printf("sws Strides:%d %d %d -> %d %d %d\n", srcStride[0],srcStride[1],srcStride[2], - //dstStride[0],dstStride[1],dstStride[2]); + DEBUG_BUFFERS("swScale() %p[%d] %p[%d] %p[%d] %p[%d] -> %p[%d] %p[%d] %p[%d] %p[%d]\n", + src[0], srcStride[0], src[1], srcStride[1], src[2], srcStride[2], src[3], srcStride[3], + dst[0], dstStride[0], dst[1], dstStride[1], dst[2], dstStride[2], dst[3], dstStride[3]); + DEBUG_BUFFERS("srcSliceY: %d srcSliceH: %d dstY: %d dstH: %d\n", + srcSliceY, srcSliceH, dstY, dstH); + DEBUG_BUFFERS("vLumFilterSize: %d vLumBufSize: %d vChrFilterSize: %d vChrBufSize: %d\n", + vLumFilterSize, vLumBufSize, vChrFilterSize, vChrBufSize); if (dstStride[0]%8 !=0 || dstStride[1]%8 !=0 || dstStride[2]%8 !=0 || dstStride[3]%8 != 0) { static int warnedAlready=0; //FIXME move this into the context perhaps @@ -2630,12 +2635,9 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s int lastChrSrcY= firstChrSrcY + vChrFilterSize -1; // Last line needed as input int enough_lines; - //printf("dstY:%d dstH:%d firstLumSrcY:%d lastInLumBuf:%d vLumBufSize: %d vChrBufSize: %d slice: %d %d vLumFilterSize: %d firstChrSrcY: %d vChrFilterSize: %d c->chrSrcVSubSample: %d\n", - // dstY, dstH, firstLumSrcY, lastInLumBuf, vLumBufSize, vChrBufSize, srcSliceY, srcSliceH, vLumFilterSize, firstChrSrcY, vChrFilterSize, c->chrSrcVSubSample); //handle holes (FAST_BILINEAR & weird filters) if (firstLumSrcY > lastInLumBuf) lastInLumBuf= firstLumSrcY-1; if (firstChrSrcY > lastInChrBuf) lastInChrBuf= firstChrSrcY-1; - //printf("%d %d %d\n", firstChrSrcY, lastInChrBuf, vChrBufSize); assert(firstLumSrcY >= lastInLumBuf - vLumBufSize + 1); assert(firstChrSrcY >= lastInChrBuf - vChrBufSize + 1); @@ -2646,21 +2648,22 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s lastChrSrcY = chrSrcSliceY + chrSrcSliceH - 1; } - /* printf("%d %d Last:%d %d LastInBuf:%d %d Index:%d %d Y:%d FSize: %d %d BSize: %d %d\n", - firstChrSrcY,firstLumSrcY,lastChrSrcY,lastLumSrcY, - lastInChrBuf,lastInLumBuf,chrBufIndex,lumBufIndex,dstY,vChrFilterSize,vLumFilterSize, - vChrBufSize, vLumBufSize);*/ + DEBUG_BUFFERS("dstY: %d\n", dstY); + DEBUG_BUFFERS("\tfirstLumSrcY: %d lastLumSrcY: %d lastInLumBuf: %d\n", + firstLumSrcY, lastLumSrcY, lastInLumBuf); + DEBUG_BUFFERS("\tfirstChrSrcY: %d lastChrSrcY: %d lastInChrBuf: %d\n", + firstChrSrcY, lastChrSrcY, lastInChrBuf); //Do horizontal scaling while(lastInLumBuf < lastLumSrcY) { uint8_t *src1= src[0]+(lastInLumBuf + 1 - srcSliceY)*srcStride[0]; uint8_t *src2= src[3]+(lastInLumBuf + 1 - srcSliceY)*srcStride[3]; lumBufIndex++; - //printf("%d %d %d %d\n", lumBufIndex, vLumBufSize, lastInLumBuf, lastLumSrcY); + DEBUG_BUFFERS("\t\tlumBufIndex %d: lastInLumBuf: %d\n", + lumBufIndex, lastInLumBuf); assert(lumBufIndex < 2*vLumBufSize); assert(lastInLumBuf + 1 - srcSliceY < srcSliceH); assert(lastInLumBuf + 1 - srcSliceY >= 0); - //printf("%d %d\n", lumBufIndex, vLumBufSize); RENAME(hyscale)(c, lumPixBuf[ lumBufIndex ], dstW, src1, srcW, lumXInc, flags, hLumFilter, hLumFilterPos, hLumFilterSize, c->srcFormat, formatConvBuffer, @@ -2676,6 +2679,8 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s uint8_t *src1= src[1]+(lastInChrBuf + 1 - chrSrcSliceY)*srcStride[1]; uint8_t *src2= src[2]+(lastInChrBuf + 1 - chrSrcSliceY)*srcStride[2]; chrBufIndex++; + DEBUG_BUFFERS("\t\tchrBufIndex %d: lastInChrBuf: %d\n", + chrBufIndex, lastInChrBuf); assert(chrBufIndex < 2*vChrBufSize); assert(lastInChrBuf + 1 - chrSrcSliceY < (chrSrcSliceH)); assert(lastInChrBuf + 1 - chrSrcSliceY >= 0); -- cgit v1.2.3 From dffa8cb272a924002d004bb40ef78a3e2497cb1a Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 17 Sep 2009 19:03:31 +0000 Subject: Use ecx instead of ebx to avoid unnecessary issues with PIC. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29687 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/aclib_template.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/libvo/aclib_template.c b/libvo/aclib_template.c index a0c5aae55d..aa02c81a21 100644 --- a/libvo/aclib_template.c +++ b/libvo/aclib_template.c @@ -277,10 +277,10 @@ static void * RENAME(fast_memcpy)(void * to, const void * from, size_t len) "xor %%"REG_a", %%"REG_a" \n\t" ASMALIGN(4) "1: \n\t" - "movl (%0, %%"REG_a"), %%ebx \n\t" - "movl 32(%0, %%"REG_a"), %%ebx \n\t" - "movl 64(%0, %%"REG_a"), %%ebx \n\t" - "movl 96(%0, %%"REG_a"), %%ebx \n\t" + "movl (%0, %%"REG_a"), %%ecx \n\t" + "movl 32(%0, %%"REG_a"), %%ecx \n\t" + "movl 64(%0, %%"REG_a"), %%ecx \n\t" + "movl 96(%0, %%"REG_a"), %%ecx \n\t" "add $128, %%"REG_a" \n\t" "cmp %3, %%"REG_a" \n\t" " jb 1b \n\t" @@ -313,10 +313,10 @@ static void * RENAME(fast_memcpy)(void * to, const void * from, size_t len) // a few percent speedup on out of order executing CPUs "mov %5, %%"REG_a" \n\t" "2: \n\t" - "movl (%0), %%ebx \n\t" - "movl (%0), %%ebx \n\t" - "movl (%0), %%ebx \n\t" - "movl (%0), %%ebx \n\t" + "movl (%0), %%ecx \n\t" + "movl (%0), %%ecx \n\t" + "movl (%0), %%ecx \n\t" + "movl (%0), %%ecx \n\t" "dec %%"REG_a" \n\t" " jnz 2b \n\t" #endif @@ -329,7 +329,7 @@ static void * RENAME(fast_memcpy)(void * to, const void * from, size_t len) " jae 1b \n\t" : "+r" (from), "+r" (to), "+r" (i) : "r" ((long)BLOCK_SIZE), "i" (BLOCK_SIZE/64), "i" ((long)CONFUSION_FACTOR) - : "%"REG_a, "%ebx" + : "%"REG_a, "%ecx" ); for(; i>0; i--) -- cgit v1.2.3 From 2eab60ecf3e6ace1bbe700c18ce6c73f2928ac28 Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 18 Sep 2009 16:51:19 +0000 Subject: Get rid of several (probably) pointless ifdefs git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29688 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index efeef5c02f..593964ee0c 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -435,10 +435,8 @@ static void uninitGl(void) { DeleteBuffers(2, gl_buffer_uv); gl_buffer_uv[0] = gl_buffer_uv[1] = 0; gl_buffersize_uv = 0; gl_bufferptr_uv[0] = gl_bufferptr_uv[1] = 0; -#ifndef GL_WIN32 if (mesa_bufferptr) FreeMemoryMESA(mDisplay, mScreen, mesa_bufferptr); -#endif mesa_bufferptr = NULL; err_shown = 0; } @@ -545,9 +543,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin if (use_gui) { // GUI creates and manages window for us guiGetEvent(guiSetShVideo, 0); -#ifndef GL_WIN32 goto glconfig; -#endif } #endif #ifdef GL_WIN32 @@ -777,7 +773,6 @@ static uint32_t get_image(mp_image_t *mpi) { mpi->stride[0] = mpi->width * mpi->bpp / 8; needed_size = mpi->stride[0] * mpi->height; if (mesa_buffer) { -#ifndef GL_WIN32 if (mesa_bufferptr && needed_size > mesa_buffersize) { FreeMemoryMESA(mDisplay, mScreen, mesa_bufferptr); mesa_bufferptr = NULL; @@ -785,7 +780,6 @@ static uint32_t get_image(mp_image_t *mpi) { if (!mesa_bufferptr) mesa_bufferptr = AllocateMemoryMESA(mDisplay, mScreen, needed_size, 0, 0, 0); mesa_buffersize = needed_size; -#endif mpi->planes[0] = mesa_bufferptr; } else { if (!gl_buffer) -- cgit v1.2.3 From f5c7d8c92f3f6cd6afcf05fed157a82fe280cd19 Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 18 Sep 2009 18:25:17 +0000 Subject: Use vo_w32_window directly instead of via the vo_window macro in Windows-only code. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29689 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c index a5e6050f44..5bbd8d15a5 100644 --- a/libvo/vo_gl2.c +++ b/libvo/vo_gl2.c @@ -117,7 +117,7 @@ static GLint getInternalFormat(void) { #ifdef GL_WIN32 PIXELFORMATDESCRIPTOR pfd; - HDC vo_hdc = GetDC(vo_window); + HDC vo_hdc = GetDC(vo_w32_window); int pf = GetPixelFormat(vo_hdc); if (!DescribePixelFormat(vo_hdc, pf, sizeof pfd, &pfd)) { r_sz = g_sz = b_sz = a_sz = 0; @@ -127,7 +127,7 @@ static GLint getInternalFormat(void) b_sz = pfd.cBlueBits; a_sz = pfd.cAlphaBits; } - ReleaseDC(vo_window, vo_hdc); + ReleaseDC(vo_w32_window, vo_hdc); #else if (glXGetConfig(mDisplay, gl_vinfo, GLX_RED_SIZE, &r_sz) != 0) r_sz = 0; if (glXGetConfig(mDisplay, gl_vinfo, GLX_GREEN_SIZE, &g_sz) != 0) g_sz = 0; -- cgit v1.2.3 From bf52efc80477374c4f916a74f74007e2d44b4210 Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 18 Sep 2009 18:46:12 +0000 Subject: Re-add some ifdefs, partially reverting r29688, since mDisplay and mScreen are undefined during a Windows build without X11 support. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29690 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index 593964ee0c..aea5cf265c 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -435,8 +435,10 @@ static void uninitGl(void) { DeleteBuffers(2, gl_buffer_uv); gl_buffer_uv[0] = gl_buffer_uv[1] = 0; gl_buffersize_uv = 0; gl_bufferptr_uv[0] = gl_bufferptr_uv[1] = 0; +#ifdef CONFIG_X11 if (mesa_bufferptr) FreeMemoryMESA(mDisplay, mScreen, mesa_bufferptr); +#endif mesa_bufferptr = NULL; err_shown = 0; } @@ -773,6 +775,7 @@ static uint32_t get_image(mp_image_t *mpi) { mpi->stride[0] = mpi->width * mpi->bpp / 8; needed_size = mpi->stride[0] * mpi->height; if (mesa_buffer) { +#ifdef CONFIG_X11 if (mesa_bufferptr && needed_size > mesa_buffersize) { FreeMemoryMESA(mDisplay, mScreen, mesa_bufferptr); mesa_bufferptr = NULL; @@ -780,6 +783,7 @@ static uint32_t get_image(mp_image_t *mpi) { if (!mesa_bufferptr) mesa_bufferptr = AllocateMemoryMESA(mDisplay, mScreen, needed_size, 0, 0, 0); mesa_buffersize = needed_size; +#endif mpi->planes[0] = mesa_bufferptr; } else { if (!gl_buffer) -- cgit v1.2.3 From 37925f4a2e887efc0973a4e4d1f700a6d373597d Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 19 Sep 2009 12:56:19 +0000 Subject: Treat Haiku as BeOS (only changes the displayed name actually) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29691 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure b/configure index a68defd6bd..18f3798732 100755 --- a/configure +++ b/configure @@ -1349,6 +1349,9 @@ if test -z "$_target" ; then case "$system_name" in Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS) ;; + Haiku) + system_name=BeOS + ;; IRIX*) system_name=IRIX ;; -- cgit v1.2.3 From a7845321db50f67e7379ca972db7539ece4fa452 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 19 Sep 2009 13:18:48 +0000 Subject: Add a check for availability of ebx register, needed for architectures that require PIE like Haiku or 64 bit OSX. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29692 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 18f3798732..5e264a3853 100755 --- a/configure +++ b/configure @@ -2553,6 +2553,24 @@ EOF cc_check && ten_operands=yes && def_ten_operands='#define HAVE_TEN_OPERANDS 1' echores $ten_operands +echocheck "ebx availability" +ebx_available=no +def_ebx_available='#define HAVE_EBX_AVAILABLE 0' +cat > $TMPC << EOF +int main(void) { + int x; + __asm__ volatile( + "xor %0, %0" + :"=b"(x) + // just adding ebx to clobber list seems unreliable with some + // compilers, e.g. Haiku's gcc 2.95 + ); + return 0; +} +EOF +cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1' +echores $ebx_available + echocheck "yasm" if test -z "$YASMFLAGS" ; then if darwin ; then @@ -8902,7 +8920,7 @@ $def_yasm #define CONFIG_RDFT 1 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */ -#define HAVE_EBX_AVAILABLE 1 +$def_ebx_available #ifndef MP_DEBUG #define HAVE_EBP_AVAILABLE 1 #else -- cgit v1.2.3 From 4aeef295900747afad2d61aaf65ead5aa9f3a6e1 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 19 Sep 2009 13:36:58 +0000 Subject: Use a compilation check to distinguish between x86 and x86_64, uname and CFLAGS checks alone are not reliable. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29693 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/configure b/configure index 5e264a3853..e963eb11e7 100755 --- a/configure +++ b/configure @@ -1392,16 +1392,8 @@ if test -z "$_target" ; then # x86/x86pc is used by QNX case "$(uname -m 2>&1)" in - i[3-9]86*|x86|x86pc|k5|k6|k6_2|k6_3|k6-2|k6-3|pentium*|athlon*|i586_i686|i586-i686|BePC) host_arch=i386 ;; + x86_64|amd64|i[3-9]86*|x86|x86pc|k5|k6|k6_2|k6_3|k6-2|k6-3|pentium*|athlon*|i586_i686|i586-i686|BePC) host_arch=i386 ;; ia64) host_arch=ia64 ;; - x86_64|amd64) - if [ -n "$($_cc -dumpmachine | sed -n '/^x86_64-/p;/^amd64-/p')" -a \ - -z "$(echo $CFLAGS $_cc | grep -- -m32)" ]; then - host_arch=x86_64 - else - host_arch=i386 - fi - ;; macppc|ppc) host_arch=ppc ;; ppc64) host_arch=ppc64 ;; alpha) host_arch=alpha ;; @@ -1442,14 +1434,6 @@ else # if test -z "$_target" fi fi -echo "Detected operating system: $system_name" -echo "Detected host architecture: $host_arch" - -if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then - die "Runtime CPU detection only works for x86, x86-64 and PPC!" -fi - - extra_cflags="-I. $extra_cflags" _timer=timer-linux.c _getch=getch2.c @@ -1532,6 +1516,24 @@ echo configuration: $_configuration > "$TMPLOG" echo >> "$TMPLOG" +if x86 ; then + cat > $TMPC << EOF +int main(void) { + int test[sizeof(char *)-7]; + return 0; +} +EOF + cc_check && host_arch=x86_64 || host_arch=i386 +fi + +echo "Detected operating system: $system_name" +echo "Detected host architecture: $host_arch" + +if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then + die "Runtime CPU detection only works for x86, x86-64 and PPC!" +fi + + # Checking CC version... # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure) if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then -- cgit v1.2.3 From d410371fa2142bc8d233395b616856fa6c06ddac Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 19 Sep 2009 13:58:38 +0000 Subject: Add autodetection for ARM NEON SIMD. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29694 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/configure b/configure index e963eb11e7..7ed1b7d216 100755 --- a/configure +++ b/configure @@ -468,6 +468,7 @@ Advanced options: --enable-armv6 enable ARMv6 (ARM) [autodetect] --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect] --enable-armvfp enable ARM VFP (ARM) [autodetect] + --enable-neon enable NEON (ARM) [autodetect] --enable-iwmmxt enable iWMMXt (ARM) [autodetect] --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable] --enable-big-endian force byte order to big-endian [autodetect] @@ -517,6 +518,7 @@ _armv5te=auto _armv6=auto _armv6t2=auto _armvfp=auto +neon=auto _iwmmxt=auto _mtrr=auto _altivec=auto @@ -1321,6 +1323,8 @@ for ac_option do --disable-armv6t2) _armv6t2=no ;; --enable-armvfp) _armvfp=yes ;; --disable-armvfp) _armvfp=no ;; + --enable-neon) neon=yes ;; + --disable-neon) neon=no ;; --enable-iwmmxt) _iwmmxt=yes ;; --disable-iwmmxt) _iwmmxt=no ;; --enable-mmx) _mmx=yes ;; @@ -2729,6 +2733,16 @@ EOF fi echores "$_armvfp" + echocheck "ARM NEON" + if test $neon = "auto" ; then + cat > $TMPC << EOF +int main(void) { __asm__ volatile ("vadd.i16 q0, q0, q0"); return 0; } +EOF + neon=no + cc_check && neon=yes + fi + echores "$neon" + echocheck "iWMMXt (Intel XScale SIMD instructions)" if test $_iwmmxt = "auto" ; then cat > $TMPC << EOF @@ -2740,7 +2754,7 @@ EOF echores "$_iwmmxt" fi -_cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP IWMMXT MMI VIS MVI' +_cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI' test "$_altivec" = yes && _cpuexts="ALTIVEC $_cpuexts" test "$_mmx" = yes && _cpuexts="MMX $_cpuexts" test "$_mmxext" = yes && _cpuexts="MMX2 $_cpuexts" @@ -2756,6 +2770,7 @@ test "$_armv5te" = yes && _cpuexts="ARMV5TE $_cpuexts" test "$_armv6" = yes && _cpuexts="ARMV6 $_cpuexts" test "$_armv6t2" = yes && _cpuexts="ARMV6T2 $_cpuexts" test "$_armvfp" = yes && _cpuexts="ARMVFP $_cpuexts" +test "$neon" = yes && _cpuexts="NEON $_cpuexts" test "$_iwmmxt" = yes && _cpuexts="IWMMXT $_cpuexts" test "$_vis" = yes && _cpuexts="VIS $_cpuexts" test "$_mvi" = yes && _cpuexts="MVI $_cpuexts" -- cgit v1.2.3 From 42448dd3a4356476b86a5199c38014e043793a75 Mon Sep 17 00:00:00 2001 From: compn Date: Sun, 20 Sep 2009 12:13:36 +0000 Subject: add coreavc entry, works on windows only. and only after buying the codec and installing it. the codec will then read the serial from your windows registry. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29695 b3059339-0415-0410-9bf9-f77b7e298cf2 --- etc/codecs.conf | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/etc/codecs.conf b/etc/codecs.conf index 782ff61809..fe84ca0b66 100644 --- a/etc/codecs.conf +++ b/etc/codecs.conf @@ -899,6 +899,22 @@ videocodec ffh264vdpau dll h264_vdpau out VDPAU_H264 +videocodec coreavcwindows + info "CoreAVC H.264 for x86 - http://corecodec.org/" + comment "this codec will only work after purchasing it" + status working + fourcc H264,h264 + fourcc X264,x264 + fourcc avc1 AVC1,AVC1 + fourcc davc,DAVC + fourcc VSSH + format 0x10000005 + driver dshow + dll "CoreAVCDecoder.ax" + guid 0x09571a4b, 0xf1fe, 0x4c60, 0x97, 0x60, 0xde, 0x6d, 0x31, 0x0c, 0x7c, 0x31 + out YV12,IYUV,I420,YUY2 + + videocodec ffsvq3 info "FFmpeg Sorenson Video v3 (SVQ3)" status working -- cgit v1.2.3 From e0f6b6051de60100c233fd5688153be4c223cd3d Mon Sep 17 00:00:00 2001 From: compn Date: Sun, 20 Sep 2009 12:31:36 +0000 Subject: add newer microsoft screen binary codec patch by william0wang (mplayer-ww). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29696 b3059339-0415-0410-9bf9-f77b7e298cf2 --- etc/codecs.conf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/etc/codecs.conf b/etc/codecs.conf index fe84ca0b66..91486d10d4 100644 --- a/etc/codecs.conf +++ b/etc/codecs.conf @@ -1164,6 +1164,16 @@ videocodec wmsdmod guid 0x7bafb3b1, 0xd8f4, 0x4279, 0x92, 0x53, 0x27, 0xda, 0x42, 0x31, 0x08, 0xde out BGR32,BGR24,BGR16 +videocodec wms10dmod + info "Windows Media Screen Codec 2 from WMP10" + status working + fourcc MSS1 + fourcc MSS2 + driver dmo + dll "wms10dmod.dll" + guid 0x7bafb3b1, 0xd8f4, 0x4279, 0x92, 0x53, 0x27, 0xda, 0x42, 0x31, 0x08, 0xde + out BGR32,BGR24,BGR16 + videocodec gotomeeting info "GoToMeeting codec" status working -- cgit v1.2.3 From 541888558ad1b0968e1a4be3c7ed40af4f507ea4 Mon Sep 17 00:00:00 2001 From: compn Date: Sun, 20 Sep 2009 12:41:21 +0000 Subject: add another aac tag patch by william0wang (mplayer-ww) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29697 b3059339-0415-0410-9bf9-f77b7e298cf2 --- etc/codecs.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/codecs.conf b/etc/codecs.conf index 91486d10d4..b0ca637c23 100644 --- a/etc/codecs.conf +++ b/etc/codecs.conf @@ -3544,6 +3544,7 @@ audiocodec ffaac format 0x706D format 0x4143 ; aac in asf format 0xA106 ; aac in avi not yet working + format 0xAAC0 ; Borgtech nonsense tag driver ffmpeg dll aac -- cgit v1.2.3 From a40c6e2018f5d761befd0f3674ad566f042f59e3 Mon Sep 17 00:00:00 2001 From: compn Date: Sun, 20 Sep 2009 14:41:35 +0000 Subject: sync faad / ffaac supported fourccs as spotted by reimar git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29698 b3059339-0415-0410-9bf9-f77b7e298cf2 --- etc/codecs.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etc/codecs.conf b/etc/codecs.conf index b0ca637c23..84660fc82f 100644 --- a/etc/codecs.conf +++ b/etc/codecs.conf @@ -3525,10 +3525,12 @@ audiocodec faad fourcc "VLB " ; Used in NSV, not really working fourcc "AAC " ; Used in NSV fourcc "AACP" ; Used in NSV for AACPlus + fourcc raac,racp format 0xff format 0x706D format 0x4143 ; aac in asf format 0xA106 ; aac in avi + format 0xAAC0 ; Borgtech nonsense tag driver faad dll libfaad2 -- cgit v1.2.3 From 7bc4102a08ce81fb4768d15393350a7be7f2140d Mon Sep 17 00:00:00 2001 From: adrian Date: Sun, 20 Sep 2009 19:07:57 +0000 Subject: Fix vo_corevideo with shared buffer after r29606: Only do GUI dependent display config if shared buffer is not enabled. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29699 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_corevideo.m | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libvo/vo_corevideo.m b/libvo/vo_corevideo.m index 18a2820360..e4b5e85545 100644 --- a/libvo/vo_corevideo.m +++ b/libvo/vo_corevideo.m @@ -161,10 +161,6 @@ static void free_file_specific(void) static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format) { free_file_specific(); - config_movie_aspect((float)d_width/d_height); - - vo_dwidth = d_width *= mpGLView->winSizeMult; - vo_dheight = d_height *= mpGLView->winSizeMult; //misc mplayer setup image_width = width; @@ -183,6 +179,11 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_ if(!shared_buffer) { + config_movie_aspect((float)d_width/d_height); + + vo_dwidth = d_width *= mpGLView->winSizeMult; + vo_dheight = d_height *= mpGLView->winSizeMult; + image_data = malloc(image_width*image_height*image_bytes); image_datas[0] = image_data; if (vo_doublebuffering) -- cgit v1.2.3 From a1e5f14ed17408a8abfc902da935a7d63fe14ff2 Mon Sep 17 00:00:00 2001 From: cehoyos Date: Tue, 22 Sep 2009 00:02:05 +0000 Subject: Allow playback of dnxhd files, as produced by FFmpeg regression test. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29700 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/mp_taglists.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libmpdemux/mp_taglists.c b/libmpdemux/mp_taglists.c index 74aba653c4..c7897da1a4 100644 --- a/libmpdemux/mp_taglists.c +++ b/libmpdemux/mp_taglists.c @@ -85,6 +85,7 @@ static const AVCodecTag mp_bmp_tags[] = { { CODEC_ID_BETHSOFTVID, MKTAG('B', 'E', 'T', 'H')}, { CODEC_ID_BFI, MKTAG('B', 'F', 'I', 'V')}, { CODEC_ID_C93, MKTAG('C', '9', '3', 'V')}, + { CODEC_ID_DNXHD, MKTAG('A', 'V', 'd', 'n')}, { CODEC_ID_DSICINVIDEO, MKTAG('D', 'C', 'I', 'V')}, { CODEC_ID_DXA, MKTAG('D', 'X', 'A', '1')}, { CODEC_ID_FLIC, MKTAG('F', 'L', 'I', 'C')}, -- cgit v1.2.3 From 5b3208baf2c8438fd54faecff5cbee0695fc81cb Mon Sep 17 00:00:00 2001 From: diego Date: Tue, 22 Sep 2009 14:38:49 +0000 Subject: Replace manual gcc version check by AV_GCC_VERSION_AT_LEAST macro. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29701 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_template.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index 27faf49d35..e842cbca23 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -2496,7 +2496,7 @@ inline static void RENAME(hcscale)(SwsContext *c, uint16_t *dst, long dstWidth, /* GCC 3.3 makes MPlayer crash on IA-32 machines when using "g" operand here, which is needed to support GCC 4.0. */ -#if ARCH_X86_64 && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +#if ARCH_X86_64 && AV_GCC_VERSION_AT_LEAST(3,4) :: "m" (src1), "m" (dst), "g" (dstWidth), "m" (xInc_shr16), "m" (xInc_mask), #else :: "m" (src1), "m" (dst), "m" (dstWidth), "m" (xInc_shr16), "m" (xInc_mask), -- cgit v1.2.3 From 4c86e46ccaf0c2cc848464ec230729de803eb8b4 Mon Sep 17 00:00:00 2001 From: cehoyos Date: Tue, 22 Sep 2009 22:06:51 +0000 Subject: Fix teletext font autoscaling. Patch by Francesco Lavra, francescolavra interfree it git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29702 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/sub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libvo/sub.c b/libvo/sub.c index 665c935b34..da3f97db0d 100644 --- a/libvo/sub.c +++ b/libvo/sub.c @@ -356,9 +356,9 @@ inline static void vo_update_text_teletext(mp_osd_obj_t *obj, int dxs, int dys) //very simple teletext font auto scaling if(!vo_osd_teletext_scale && hm*(max_rows+1)>dys){ - text_font_scale_factor*=1.0*(dys)/((max_rows+1)*hm); + osd_font_scale_factor*=1.0*(dys)/((max_rows+1)*hm); force_load_font=1; - vo_osd_teletext_scale=text_font_scale_factor; + vo_osd_teletext_scale=osd_font_scale_factor; obj->flags&=~OSDFLAG_VISIBLE; return; } -- cgit v1.2.3 From f318d4c900e1920d7ab09738aed9488ddee63089 Mon Sep 17 00:00:00 2001 From: diego Date: Wed, 23 Sep 2009 09:12:19 +0000 Subject: Add 0x85 ad ID for DTS audio. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29703 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_ts.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libmpdemux/demux_ts.c b/libmpdemux/demux_ts.c index 109275a7fa..c7966da9ba 100644 --- a/libmpdemux/demux_ts.c +++ b/libmpdemux/demux_ts.c @@ -2521,6 +2521,7 @@ static int parse_pmt(ts_priv_t * priv, uint16_t progid, uint16_t pid, int is_sta break; case 0x8A: case 0x82: + case 0x85: case 0x86: pmt->es[idx].type = AUDIO_DTS; break; -- cgit v1.2.3 From 189361565643031d6d555f31b69129e7159f18ab Mon Sep 17 00:00:00 2001 From: lorenm Date: Wed, 23 Sep 2009 12:01:04 +0000 Subject: sync to x264-r1260 (which changed api) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29704 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 4 ++-- libmpcodecs/ve_x264.c | 41 ++++++++--------------------------------- 2 files changed, 10 insertions(+), 35 deletions(-) diff --git a/configure b/configure index 7ed1b7d216..780a4c48a2 100755 --- a/configure +++ b/configure @@ -7240,8 +7240,8 @@ if test "$_x264" = auto ; then cat > $TMPC << EOF #include #include -#if X264_BUILD < 65 -#error We do not support old versions of x264. Get the latest from SVN. +#if X264_BUILD < 76 +#error We do not support old versions of x264. Get the latest from git. #endif int main(void) { x264_encoder_open((void*)0); return 0; } EOF diff --git a/libmpcodecs/ve_x264.c b/libmpcodecs/ve_x264.c index 8a4a1147f3..01f87fd040 100644 --- a/libmpcodecs/ve_x264.c +++ b/libmpcodecs/ve_x264.c @@ -59,20 +59,6 @@ static int turbo = 0; static x264_param_t param; static int parse_error = 0; -static int encode_nals(uint8_t *buf, int size, x264_nal_t *nals, int nnal){ - uint8_t *p = buf; - int i; - - for(i = 0; i < nnal; i++){ - int s = x264_nal_encode(p, &size, 1, nals + i); - if(s < 0) - return -1; - p += s; - } - - return p - buf; -} - static int put_image(struct vf_instance_s *vf, mp_image_t *mpi, double pts); static int encode_frame(struct vf_instance_s *vf, x264_picture_t *pic_in); @@ -189,21 +175,13 @@ static int config(struct vf_instance_s* vf, int width, int height, int d_width, } if(!param.b_repeat_headers){ - uint8_t *extradata; x264_nal_t *nal; - int extradata_size, nnal, i, s = 0; + int extradata_size, nnal; - x264_encoder_headers(mod->x264, &nal, &nnal); - - /* 5 bytes NAL header + worst case escaping */ - for(i = 0; i < nnal; i++) - s += 5 + nal[i].i_payload * 4 / 3; - - extradata = malloc(s); - extradata_size = encode_nals(extradata, s, nal, nnal); + extradata_size = x264_encoder_headers(mod->x264, &nal, &nnal); mod->mux->bih= realloc(mod->mux->bih, sizeof(BITMAPINFOHEADER) + extradata_size); - memcpy(mod->mux->bih + 1, extradata, extradata_size); + memcpy(mod->mux->bih + 1, nal->p_payload, extradata_size); mod->mux->bih->biSize= sizeof(BITMAPINFOHEADER) + extradata_size; } @@ -273,23 +251,20 @@ static int encode_frame(struct vf_instance_s *vf, x264_picture_t *pic_in) x264_picture_t pic_out; x264_nal_t *nal; int i_nal; - int i_size = 0; - int i; + int i_size; - if(x264_encoder_encode(mod->x264, &nal, &i_nal, pic_in, &pic_out) < 0) { + i_size = x264_encoder_encode(mod->x264, &nal, &i_nal, pic_in, &pic_out); + + if(i_size<0) { mp_msg(MSGT_MENCODER, MSGL_ERR, "x264_encoder_encode failed\n"); return -1; } - - for(i=0; i < i_nal; i++) { - int i_data = mod->mux->buffer_size - i_size; - i_size += x264_nal_encode(mod->mux->buffer + i_size, &i_data, 1, &nal[i]); - } if(i_size>0) { int keyframe = (pic_out.i_type == X264_TYPE_IDR) || (pic_out.i_type == X264_TYPE_I && param.i_frame_reference == 1 && !param.i_bframe); + memcpy(mod->mux->buffer, nal->p_payload, i_size); muxer_write_chunk(mod->mux, i_size, keyframe?0x10:0, MP_NOPTS_VALUE, MP_NOPTS_VALUE); } else -- cgit v1.2.3 From de85aebe1ec10c85f064805e7e630301adb89775 Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 23 Sep 2009 12:26:44 +0000 Subject: Use x264_encoder_delayed_frames instead of the current hack to flush delayed frames in VFCTRL_FLUSH_FRAMES. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29705 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ve_x264.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libmpcodecs/ve_x264.c b/libmpcodecs/ve_x264.c index 01f87fd040..36a42406a5 100644 --- a/libmpcodecs/ve_x264.c +++ b/libmpcodecs/ve_x264.c @@ -196,12 +196,10 @@ static int config(struct vf_instance_s* vf, int width, int height, int d_width, static int control(struct vf_instance_s* vf, int request, void *data) { h264_module_t *mod=(h264_module_t*)vf->priv; - int count = 256; // giant HACK, x264_encoder_encode may incorrectly return 0 - // when threads > 1 and delayed frames pending switch(request){ case VFCTRL_FLUSH_FRAMES: - while(encode_frame(vf, NULL) == 0 && --count); - while(encode_frame(vf, NULL) > 0); + while (x264_encoder_delayed_frames(mod->x264) > 0) + encode_frame(vf, NULL); return CONTROL_TRUE; default: return CONTROL_UNKNOWN; -- cgit v1.2.3 From 5c6d055a15fdeb48315b8eeea0ee51d3301d01e8 Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 23 Sep 2009 18:28:20 +0000 Subject: Rename ambiguous "pts" variable to subpts. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29706 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mpcommon.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mpcommon.c b/mpcommon.c index ba738dcee4..bbdfd32b7a 100644 --- a/mpcommon.c +++ b/mpcommon.c @@ -147,8 +147,8 @@ void update_subtitles(sh_video_t *sh_video, demux_stream_t *d_dvdsub, int reset) double endpts; vo_sub = &subs; while (d_dvdsub->first) { - double pts = ds_get_next_pts(d_dvdsub); - if (pts > curpts) + double subpts = ds_get_next_pts(d_dvdsub); + if (subpts > curpts) break; endpts = d_dvdsub->first->endpts; len = ds_get_packet_sub(d_dvdsub, &packet); @@ -164,15 +164,15 @@ void update_subtitles(sh_video_t *sh_video, demux_stream_t *d_dvdsub, int reset) if (!ass_track) continue; if (type == 'a') { // ssa/ass subs with libass ass_process_chunk(ass_track, packet, len, - (long long)(pts*1000 + 0.5), - (long long)((endpts-pts)*1000 + 0.5)); + (long long)(subpts*1000 + 0.5), + (long long)((endpts-subpts)*1000 + 0.5)); } else { // plaintext subs with libass vo_sub = NULL; - if (pts != MP_NOPTS_VALUE) { - if (endpts == MP_NOPTS_VALUE) endpts = pts + 3; + if (subpts != MP_NOPTS_VALUE) { + if (endpts == MP_NOPTS_VALUE) endpts = subpts + 3; sub_clear_text(&subs, MP_NOPTS_VALUE); sub_add_text(&subs, packet, len, endpts); - subs.start = pts * 100; + subs.start = subpts * 100; subs.end = endpts * 100; ass_process_subtitle(ass_track, &subs); } @@ -180,7 +180,7 @@ void update_subtitles(sh_video_t *sh_video, demux_stream_t *d_dvdsub, int reset) continue; } #endif - if (pts != MP_NOPTS_VALUE) { + if (subpts != MP_NOPTS_VALUE) { if (endpts == MP_NOPTS_VALUE) sub_clear_text(&subs, MP_NOPTS_VALUE); if (type == 'a') { // ssa/ass subs without libass => convert to plaintext -- cgit v1.2.3 From 8dad891bf98a8e51fe3bbbc3d2a0cbfc8f8a7268 Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 23 Sep 2009 19:01:33 +0000 Subject: Factor out sh_video->pts into a refpts variable. This simplifies a future patch that reduces the dependency on sh_video. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29707 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mpcommon.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/mpcommon.c b/mpcommon.c index bbdfd32b7a..c0b5acc806 100644 --- a/mpcommon.c +++ b/mpcommon.c @@ -71,6 +71,7 @@ void update_subtitles(sh_video_t *sh_video, demux_stream_t *d_dvdsub, int reset) int len; char type = d_dvdsub->sh ? ((sh_sub_t *)d_dvdsub->sh)->type : 'v'; static subtitle subs; + double refpts = sh_video->pts; if (reset) { sub_clear_text(&subs, MP_NOPTS_VALUE); if (vo_sub) { @@ -84,15 +85,14 @@ void update_subtitles(sh_video_t *sh_video, demux_stream_t *d_dvdsub, int reset) } // find sub if (subdata) { - double pts = sh_video->pts; if (sub_fps==0) sub_fps = sh_video->fps; current_module = "find_sub"; - if (pts > sub_last_pts || pts < sub_last_pts-1.0) { - find_sub(subdata, (pts+sub_delay) * + if (refpts > sub_last_pts || refpts < sub_last_pts-1.0) { + find_sub(subdata, (refpts+sub_delay) * (subdata->sub_uses_time ? 100. : sub_fps)); if (vo_sub) vo_sub_last = vo_sub; // FIXME! frame counter... - sub_last_pts = pts; + sub_last_pts = refpts; } } @@ -108,12 +108,12 @@ void update_subtitles(sh_video_t *sh_video, demux_stream_t *d_dvdsub, int reset) // Vobsub len = 0; if (vo_vobsub) { - if (sh_video->pts+sub_delay >= 0) { - len = vobsub_get_packet(vo_vobsub, sh_video->pts+sub_delay, + if (refpts+sub_delay >= 0) { + len = vobsub_get_packet(vo_vobsub, refpts+sub_delay, (void**)&packet, ×tamp); if (len > 0) { - timestamp -= (sh_video->pts + sub_delay - sh_video->timer)*90000; - mp_dbg(MSGT_CPLAYER,MSGL_V,"\rVOB sub: len=%d v_pts=%5.3f v_timer=%5.3f sub=%5.3f ts=%d \n",len,sh_video->pts,sh_video->timer,timestamp / 90000.0,timestamp); + timestamp -= (refpts + sub_delay - sh_video->timer)*90000; + mp_dbg(MSGT_CPLAYER,MSGL_V,"\rVOB sub: len=%d v_pts=%5.3f v_timer=%5.3f sub=%5.3f ts=%d \n",len,refpts,sh_video->timer,timestamp / 90000.0,timestamp); } } } else { @@ -125,14 +125,14 @@ void update_subtitles(sh_video_t *sh_video, demux_stream_t *d_dvdsub, int reset) // d_video->pts which would have been the simplest // improvement doesn't work because mpeg specific hacks // in video.c set d_video->pts to 0. - float x = d_dvdsub->pts - sh_video->pts; + float x = d_dvdsub->pts - refpts; if (x > -20 && x < 20) // prevent missing subs on pts reset timestamp = 90000*(sh_video->timer + d_dvdsub->pts - + sub_delay - sh_video->pts); + + sub_delay - refpts); else timestamp = 90000*(sh_video->timer + sub_delay); mp_dbg(MSGT_CPLAYER, MSGL_V, "\rDVD sub: len=%d " "v_pts=%5.3f s_pts=%5.3f ts=%d \n", len, - sh_video->pts, d_dvdsub->pts, timestamp); + refpts, d_dvdsub->pts, timestamp); } } if (len<=0 || !packet) break; @@ -143,7 +143,7 @@ void update_subtitles(sh_video_t *sh_video, demux_stream_t *d_dvdsub, int reset) if (spudec_changed(vo_spudec)) vo_osd_changed(OSDTYPE_SPU); } else if (dvdsub_id >= 0 && (type == 't' || type == 'm' || type == 'a')) { - double curpts = sh_video->pts + sub_delay; + double curpts = refpts + sub_delay; double endpts; vo_sub = &subs; while (d_dvdsub->first) { -- cgit v1.2.3 From f9c8809a396ba7d587544ef92e952ff894ab9972 Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 23 Sep 2009 19:04:24 +0000 Subject: Include mpcommon.h in mpcommon.c, ensures that the declarations in the header match those in the file. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29708 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mpcommon.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mpcommon.c b/mpcommon.c index c0b5acc806..394a71461f 100644 --- a/mpcommon.c +++ b/mpcommon.c @@ -14,6 +14,7 @@ #include "stream/tv.h" #include "libavutil/intreadwrite.h" #include "m_option.h" +#include "mpcommon.h" double sub_last_pts = -303; -- cgit v1.2.3 From 4834e2116289f92edc49dc8e595e70adcdc26cec Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 23 Sep 2009 19:21:38 +0000 Subject: Make sure avctx->codec_type and codec_id are set, since libavcodec currently requires that. That probably is an unintended API change and should be fixed/reverted in lavc but it hurts little to workaround here. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29709 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ad_ffmpeg.c | 1 + libmpcodecs/vd_ffmpeg.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/libmpcodecs/ad_ffmpeg.c b/libmpcodecs/ad_ffmpeg.c index 97156efadf..a997fbe245 100644 --- a/libmpcodecs/ad_ffmpeg.c +++ b/libmpcodecs/ad_ffmpeg.c @@ -68,6 +68,7 @@ static int init(sh_audio_t *sh_audio) } lavc_context->request_channels = audio_output_channels; lavc_context->codec_tag = sh_audio->format; //FOURCC + lavc_context->codec_type = CODEC_TYPE_AUDIO; lavc_context->codec_id = lavc_codec->id; // not sure if required, imho not --A'rpi /* alloc extra data */ diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index 68e7c3aa17..d2d7c845eb 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -257,6 +257,8 @@ static int init(sh_video_t *sh){ ctx->avctx = avcodec_alloc_context(); avctx = ctx->avctx; avctx->opaque = sh; + avctx->codec_type = CODEC_TYPE_VIDEO; + avctx->codec_id = lavc_codec->id; #if CONFIG_VDPAU if(lavc_codec->capabilities & CODEC_CAP_HWACCEL_VDPAU){ -- cgit v1.2.3 From bf16f6f4f329b7903ba550c458545fbdb41f5314 Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 23 Sep 2009 21:21:58 +0000 Subject: Make update_subtitles work without sh_video for text subtitles. This fixes a crash with e.g. auto-enabled subtitles and -novideo due to command.c calling update_subtitles even without video and is a step toward subtitle support for audio-only files. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29710 b3059339-0415-0410-9bf9-f77b7e298cf2 --- command.c | 7 ++++++- mencoder.c | 2 +- mpcommon.c | 5 ++--- mpcommon.h | 2 +- mplayer.c | 6 +++--- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/command.c b/command.c index 5aee6ae383..3269db5949 100644 --- a/command.c +++ b/command.c @@ -1314,6 +1314,7 @@ static int mp_property_sub(m_option_t * prop, int action, void *arg, demux_stream_t *const d_sub = mpctx->d_sub; const int global_sub_size = mpctx->global_sub_size; int source = -1, reset_spu = 0; + double pts = 0; char *sub_name; if (global_sub_size <= 0) @@ -1500,7 +1501,11 @@ static int mp_property_sub(m_option_t * prop, int action, void *arg, d_sub->id = dvdsub_id; } #endif - update_subtitles(mpctx->sh_video, d_sub, 1); + if (mpctx->sh_audio) + pts = mpctx->sh_audio->pts; + if (mpctx->sh_video) + pts = mpctx->sh_video->pts; + update_subtitles(mpctx->sh_video, pts, d_sub, 1); return M_PROPERTY_OK; } diff --git a/mencoder.c b/mencoder.c index 5b569bb5fd..8d43106fde 100644 --- a/mencoder.c +++ b/mencoder.c @@ -1454,7 +1454,7 @@ if(sh_audio && !demuxer2){ } else #endif - update_subtitles(sh_video, d_dvdsub, 0); + update_subtitles(sh_video, sh_video->pts, d_dvdsub, 0); frame_data = (s_frame_data){ .start = NULL, .in_size = 0, .frame_time = 0., .already_read = 0 }; diff --git a/mpcommon.c b/mpcommon.c index 394a71461f..e28614390d 100644 --- a/mpcommon.c +++ b/mpcommon.c @@ -66,13 +66,12 @@ if (HAVE_CMOV) } -void update_subtitles(sh_video_t *sh_video, demux_stream_t *d_dvdsub, int reset) +void update_subtitles(sh_video_t *sh_video, double refpts, demux_stream_t *d_dvdsub, int reset) { unsigned char *packet=NULL; int len; char type = d_dvdsub->sh ? ((sh_sub_t *)d_dvdsub->sh)->type : 'v'; static subtitle subs; - double refpts = sh_video->pts; if (reset) { sub_clear_text(&subs, MP_NOPTS_VALUE); if (vo_sub) { @@ -86,7 +85,7 @@ void update_subtitles(sh_video_t *sh_video, demux_stream_t *d_dvdsub, int reset) } // find sub if (subdata) { - if (sub_fps==0) sub_fps = sh_video->fps; + if (sub_fps==0) sub_fps = sh_video ? sh_video->fps : 25; current_module = "find_sub"; if (refpts > sub_last_pts || refpts < sub_last_pts-1.0) { find_sub(subdata, (refpts+sub_delay) * diff --git a/mpcommon.h b/mpcommon.h index a0c6fb8ff8..98f3d4e075 100644 --- a/mpcommon.h +++ b/mpcommon.h @@ -10,7 +10,7 @@ extern struct ass_track_s *ass_track; extern subtitle *vo_sub_last; void print_version(const char* name); -void update_subtitles(sh_video_t *sh_video, demux_stream_t *d_dvdsub, int reset); +void update_subtitles(sh_video_t *sh_video, double pts, demux_stream_t *d_dvdsub, int reset); void update_teletext(sh_video_t *sh_video, demuxer_t *demuxer, int reset); int select_audio(demuxer_t* demuxer, int audio_id, char* audio_lang); diff --git a/mplayer.c b/mplayer.c index 59a0b48a7f..7064223e09 100644 --- a/mplayer.c +++ b/mplayer.c @@ -1767,7 +1767,7 @@ static int generate_video_frame(sh_video_t *sh_video, demux_stream_t *d_video) current_module = "decode video"; decoded_frame = decode_video(sh_video, start, in_size, drop_frame, pts); if (decoded_frame) { - update_subtitles(sh_video, mpctx->d_sub, 0); + update_subtitles(sh_video, sh_video->pts, mpctx->d_sub, 0); update_teletext(sh_video, mpctx->demuxer, 0); update_osd_msg(); current_module = "filter video"; @@ -2290,7 +2290,7 @@ static double update_video(int *blit_frame) // video_read_frame can change fps (e.g. for ASF video) vo_fps = sh_video->fps; drop_frame = check_framedrop(frame_time); - update_subtitles(sh_video, mpctx->d_sub, 0); + update_subtitles(sh_video, sh_video->pts, mpctx->d_sub, 0); update_teletext(sh_video, mpctx->demuxer, 0); update_osd_msg(); current_module = "decode_video"; @@ -2483,7 +2483,7 @@ static int seek(MPContext *mpctx, double amount, int style) // (which is used by at least vobsub and edl code below) may // be completely wrong (probably 0). mpctx->sh_video->pts = mpctx->d_video->pts; - update_subtitles(mpctx->sh_video, mpctx->d_sub, 1); + update_subtitles(mpctx->sh_video, mpctx->sh_video->pts, mpctx->d_sub, 1); update_teletext(mpctx->sh_video, mpctx->demuxer, 1); } -- cgit v1.2.3 From 1b927153645d10acd173d6909f19acc27f728536 Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 23 Sep 2009 21:27:36 +0000 Subject: Make function argument name in header match name in .c file. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29711 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mpcommon.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpcommon.h b/mpcommon.h index 98f3d4e075..65e2c52edc 100644 --- a/mpcommon.h +++ b/mpcommon.h @@ -10,7 +10,7 @@ extern struct ass_track_s *ass_track; extern subtitle *vo_sub_last; void print_version(const char* name); -void update_subtitles(sh_video_t *sh_video, double pts, demux_stream_t *d_dvdsub, int reset); +void update_subtitles(sh_video_t *sh_video, double refpts, demux_stream_t *d_dvdsub, int reset); void update_teletext(sh_video_t *sh_video, demuxer_t *demuxer, int reset); int select_audio(demuxer_t* demuxer, int audio_id, char* audio_lang); -- cgit v1.2.3 From 4b182ff652ee52647913a065801df12c99989173 Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 23 Sep 2009 21:48:48 +0000 Subject: Add support for displaying subtitles on the command-line when playing audio-only files. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29712 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mencoder.c | 6 ++++++ mp_osd.h | 1 + mpcommon.c | 9 +++------ mpcommon.h | 1 + mplayer.c | 23 +++++++++++++++++++++++ 5 files changed, 34 insertions(+), 6 deletions(-) diff --git a/mencoder.c b/mencoder.c index 8d43106fde..b17e2be6a8 100644 --- a/mencoder.c +++ b/mencoder.c @@ -218,6 +218,12 @@ void mplayer_put_key(int code) char *current_module; #include "mpcommon.h" +// Needed by mpcommon.c +void set_osd_subtitle(subtitle *subs) { + vo_sub = subs; + vo_osd_changed(OSDTYPE_SUBTITLE); +} + //char *out_audio_codec=NULL; // override audio codec //char *out_video_codec=NULL; // override video codec diff --git a/mp_osd.h b/mp_osd.h index f3b2a69561..adaba8adab 100644 --- a/mp_osd.h +++ b/mp_osd.h @@ -11,6 +11,7 @@ #define OSD_MSG_RADIO_CHANNEL 7 /// Base id for messages generated from the commmand to property bridge. #define OSD_MSG_PROPERTY 0x100 +#define OSD_MSG_SUB_BASE 0x1000 #define MAX_OSD_LEVEL 3 #define MAX_TERM_OSD_LEVEL 1 diff --git a/mpcommon.c b/mpcommon.c index e28614390d..162dbbf26e 100644 --- a/mpcommon.c +++ b/mpcommon.c @@ -75,8 +75,7 @@ void update_subtitles(sh_video_t *sh_video, double refpts, demux_stream_t *d_dvd if (reset) { sub_clear_text(&subs, MP_NOPTS_VALUE); if (vo_sub) { - vo_sub = NULL; - vo_osd_changed(OSDTYPE_SUBTITLE); + set_osd_subtitle(NULL); } if (vo_spudec) { spudec_reset(vo_spudec); @@ -145,7 +144,6 @@ void update_subtitles(sh_video_t *sh_video, double refpts, demux_stream_t *d_dvd } else if (dvdsub_id >= 0 && (type == 't' || type == 'm' || type == 'a')) { double curpts = refpts + sub_delay; double endpts; - vo_sub = &subs; while (d_dvdsub->first) { double subpts = ds_get_next_pts(d_dvdsub); if (subpts > curpts) @@ -167,7 +165,6 @@ void update_subtitles(sh_video_t *sh_video, double refpts, demux_stream_t *d_dvd (long long)(subpts*1000 + 0.5), (long long)((endpts-subpts)*1000 + 0.5)); } else { // plaintext subs with libass - vo_sub = NULL; if (subpts != MP_NOPTS_VALUE) { if (endpts == MP_NOPTS_VALUE) endpts = subpts + 3; sub_clear_text(&subs, MP_NOPTS_VALUE); @@ -195,11 +192,11 @@ void update_subtitles(sh_video_t *sh_video, double refpts, demux_stream_t *d_dvd packet = p; } sub_add_text(&subs, packet, len, endpts); - vo_osd_changed(OSDTYPE_SUBTITLE); + set_osd_subtitle(&subs); } } if (sub_clear_text(&subs, curpts)) - vo_osd_changed(OSDTYPE_SUBTITLE); + set_osd_subtitle(&subs); } current_module=NULL; } diff --git a/mpcommon.h b/mpcommon.h index 65e2c52edc..486faa7012 100644 --- a/mpcommon.h +++ b/mpcommon.h @@ -13,6 +13,7 @@ void print_version(const char* name); void update_subtitles(sh_video_t *sh_video, double refpts, demux_stream_t *d_dvdsub, int reset); void update_teletext(sh_video_t *sh_video, demuxer_t *demuxer, int reset); int select_audio(demuxer_t* demuxer, int audio_id, char* audio_lang); +void set_osd_subtitle(subtitle *subs); extern int disable_system_conf; extern int disable_user_conf; diff --git a/mplayer.c b/mplayer.c index 7064223e09..aa59ab7088 100644 --- a/mplayer.c +++ b/mplayer.c @@ -1507,6 +1507,26 @@ void set_osd_bar(int type,const char* name,double min,double max,double val) { name,ROUND(100*(val-min)/(max-min))); } +/** + * \brief Display text subtitles on the OSD + */ +void set_osd_subtitle(subtitle *subs) { + int i; + vo_sub = subs; + vo_osd_changed(OSDTYPE_SUBTITLE); + if (!mpctx->sh_video) { + // reverse order, since newest set_osd_msg is displayed first + for (i = SUB_MAX_TEXT - 1; i >= 0; i--) { + if (!subs || i >= subs->lines || !subs->text[i]) + rm_osd_msg(OSD_MSG_SUB_BASE + i); + else { + // HACK: currently display time for each sub line except the last is set to 2 seconds. + int display_time = i == subs->lines - 1 ? 180000 : 2000; + set_osd_msg(OSD_MSG_SUB_BASE + i, 1, display_time, "%s", subs->text[i]); + } + } + } +} /** * \brief Update the OSD message line. @@ -2492,6 +2512,8 @@ static int seek(MPContext *mpctx, double amount, int style) mpctx->audio_out->reset(); // stop audio, throwing away buffered data mpctx->sh_audio->a_buffer_len = 0; mpctx->sh_audio->a_out_buffer_len = 0; + if (!mpctx->sh_video) + update_subtitles(NULL, mpctx->sh_audio->pts, mpctx->d_sub, 1); } if (vo_vobsub && mpctx->sh_video) { @@ -3704,6 +3726,7 @@ if(!mpctx->sh_video) { if(end_at.type == END_AT_TIME && end_at.pos < a_pos) mpctx->eof = PT_NEXT_ENTRY; + update_subtitles(NULL, mpctx->sh_audio->pts, mpctx->d_sub, 0); update_osd_msg(); } else { -- cgit v1.2.3 From 76141a5727ee1cf38aad29fb222f70ec2f0494c6 Mon Sep 17 00:00:00 2001 From: diego Date: Thu, 24 Sep 2009 09:47:36 +0000 Subject: sync with FFmpeg build: BUILD_STATIC --> CONFIG_STATIC git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29713 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 2 +- subdir.mak | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 780a4c48a2..a73cee232d 100755 --- a/configure +++ b/configure @@ -8435,7 +8435,7 @@ LIBSWSCALE = $_libswscale LIBSWSCALE_A = $_libswscale_a LIBSWSCALE_SO = $_libswscale_so -BUILD_STATIC=yes +CONFIG_STATIC=yes SRC_PATH=.. BUILD_ROOT=.. LIBPREF=lib diff --git a/subdir.mak b/subdir.mak index 7148ce6fcd..20e5d97667 100644 --- a/subdir.mak +++ b/subdir.mak @@ -5,7 +5,7 @@ include $(SUBDIR)../common.mak LIBVERSION := $(lib$(NAME)_VERSION) LIBMAJOR := $(lib$(NAME)_VERSION_MAJOR) -ifeq ($(BUILD_STATIC),yes) +ifeq ($(CONFIG_STATIC),yes) all: $(SUBDIR)$(LIBNAME) install-libs: install-lib$(NAME)-static @@ -18,7 +18,7 @@ endif INCINSTDIR := $(INCDIR)/lib$(NAME) -THIS_LIB := $(SUBDIR)$($(BUILD_SHARED:yes=S)LIBNAME) +THIS_LIB := $(SUBDIR)$($(CONFIG_SHARED:yes=S)LIBNAME) define RULES $(SUBDIR)%$(EXESUF): $(SUBDIR)%.o @@ -44,7 +44,7 @@ distclean:: clean rm -f $(addprefix $(SUBDIR),$(DISTCLEANSUFFIXES)) \ $(addprefix $(SUBDIR), $(foreach suffix,$(DISTCLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS)))) -ifdef BUILD_SHARED +ifdef CONFIG_SHARED all: $(SUBDIR)$(SLIBNAME) install-libs: install-lib$(NAME)-shared -- cgit v1.2.3 From e3b68c274596768a110ac65d4ab7d37a3960ddc6 Mon Sep 17 00:00:00 2001 From: diego Date: Thu, 24 Sep 2009 10:09:14 +0000 Subject: Sync with current FFmpeg HEAD. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29714 b3059339-0415-0410-9bf9-f77b7e298cf2 --- common.mak | 32 ++++++++++++-------------------- configure | 2 ++ subdir.mak | 14 ++++++-------- 3 files changed, 20 insertions(+), 28 deletions(-) diff --git a/common.mak b/common.mak index 23907af9f2..343ca749b5 100644 --- a/common.mak +++ b/common.mak @@ -18,27 +18,18 @@ endif ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale -CFLAGS := -DHAVE_AV_CONFIG_H -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(OPTFLAGS) +CPPFLAGS := -DHAVE_AV_CONFIG_H -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(CPPFLAGS) %.o: %.c - $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $< + $(CCDEP) + $(CC) $(CPPFLAGS) $(CFLAGS) $(CC_DEPFLAGS) -c $(CC_O) $< %.o: %.S - $(AS) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $< + $(ASDEP) + $(AS) $(CPPFLAGS) $(ASFLAGS) $(AS_DEPFLAGS) -c -o $@ $< %.ho: %.h - $(CC) $(CFLAGS) $(LIBOBJFLAGS) -Wno-unused -c -o $@ -x c $< - -%.d: %.c - $(DEPEND_CMD) > $@ - -%.d: %.S - $(DEPEND_CMD) > $@ - -%.d: %.cpp - $(DEPEND_CMD) > $@ - -%.o: %.d + $(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused -c -o $@ -x c $< %$(EXESUF): %.c @@ -71,16 +62,17 @@ EXAMPLES := $(addprefix $(SUBDIR),$(addsuffix -example$(EXESUF),$(EXAMPLES))) OBJS := $(addprefix $(SUBDIR),$(OBJS)) TESTPROGS := $(addprefix $(SUBDIR),$(addsuffix -test$(EXESUF),$(TESTPROGS))) -DEP_LIBS := $(foreach NAME,$(FFLIBS),lib$(NAME)/$($(BUILD_SHARED:yes=S)LIBNAME)) +DEP_LIBS := $(foreach NAME,$(FFLIBS),$(BUILD_ROOT_REL)/lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME)) ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h)) -checkheaders: $(filter-out %_template.ho,$(ALLHEADERS:.h=.ho)) +SKIPHEADERS = $(addprefix $(SUBDIR),$(SKIPHEADERS-)) +checkheaders: $(filter-out $(SKIPHEADERS:.h=.ho),$(ALLHEADERS:.h=.ho)) DEPS := $(OBJS:.o=.d) depend dep: $(DEPS) -CLEANSUFFIXES = *.o *~ *.ho +CLEANSUFFIXES = *.o *~ *.ho *.map DISTCLEANSUFFIXES = *.d *.pc -LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp *.map +LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp --include $(DEPS) +-include $(wildcard $(DEPS)) diff --git a/configure b/configure index a73cee232d..daa8c339f1 100755 --- a/configure +++ b/configure @@ -8435,6 +8435,8 @@ LIBSWSCALE = $_libswscale LIBSWSCALE_A = $_libswscale_a LIBSWSCALE_SO = $_libswscale_so +CC_O=-o \$@ +LD=gcc CONFIG_STATIC=yes SRC_PATH=.. BUILD_ROOT=.. diff --git a/subdir.mak b/subdir.mak index 20e5d97667..d89573904e 100644 --- a/subdir.mak +++ b/subdir.mak @@ -22,22 +22,20 @@ THIS_LIB := $(SUBDIR)$($(CONFIG_SHARED:yes=S)LIBNAME) define RULES $(SUBDIR)%$(EXESUF): $(SUBDIR)%.o - $(CC) $(FFLDFLAGS) -o $$@ $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS) + $(LD) $(FFLDFLAGS) -o $$@ $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS) $(SUBDIR)%-test.o: $(SUBDIR)%.c - $(CC) $(CFLAGS) -DTEST -c -o $$@ $$^ + $(CC) $(CPPFLAGS) $(CFLAGS) -DTEST -c -o $$@ $$^ $(SUBDIR)%-test.o: $(SUBDIR)%-test.c - $(CC) $(CFLAGS) -DTEST -c -o $$@ $$^ + $(CC) $(CPPFLAGS) $(CFLAGS) -DTEST -c -o $$@ $$^ $(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm + $(YASM) $(YASMFLAGS) -I $$( $$(@:.o=.d) $(YASM) $(YASMFLAGS) -I $$( $$@ - clean:: - rm -f $(EXAMPLES) $(addprefix $(SUBDIR),*-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \ + rm -f $(addprefix $(SUBDIR),*-example$(EXESUF) *-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \ $(addprefix $(SUBDIR), $(foreach suffix,$(CLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS)))) distclean:: clean @@ -54,7 +52,7 @@ $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR) $(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SLIB_CREATE_DEF_CMD) - $(CC) $(SHFLAGS) $(FFLDFLAGS) -o $$@ $$(filter-out $(DEP_LIBS),$$^) $(FFEXTRALIBS) $(EXTRAOBJS) + $(LD) $(SHFLAGS) $(FFLDFLAGS) -o $$@ $$(filter %.o,$$^) $(FFEXTRALIBS) $(EXTRAOBJS) $(SLIB_EXTRA_CMD) ifdef SUBDIR -- cgit v1.2.3 From 101d331f62d07a8bf8c7044eba1534027cab4910 Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 25 Sep 2009 09:43:59 +0000 Subject: Set codec_type and codec_id in codec context for lavc encoders. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29715 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ae_lavc.c | 2 ++ libmpcodecs/ve_lavc.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/libmpcodecs/ae_lavc.c b/libmpcodecs/ae_lavc.c index 858123cee9..519e8f05c7 100644 --- a/libmpcodecs/ae_lavc.c +++ b/libmpcodecs/ae_lavc.c @@ -203,6 +203,8 @@ int mpae_init_lavc(audio_encoder_t *encoder) return 0; } + lavc_actx->codec_type = CODEC_TYPE_AUDIO; + lavc_actx->codec_id = lavc_acodec->id; // put sample parameters lavc_actx->channels = encoder->params.channels; lavc_actx->sample_rate = encoder->params.sample_rate; diff --git a/libmpcodecs/ve_lavc.c b/libmpcodecs/ve_lavc.c index 50368858c3..951941d585 100644 --- a/libmpcodecs/ve_lavc.c +++ b/libmpcodecs/ve_lavc.c @@ -1047,6 +1047,8 @@ static int vf_open(vf_instance_t *vf, char* args){ vf->priv->pic = avcodec_alloc_frame(); vf->priv->context = avcodec_alloc_context(); + vf->priv->context->codec_type = CODEC_TYPE_VIDEO; + vf->priv->context->codec_id = vf->priv->codec->id; return 1; } -- cgit v1.2.3 From 3f9cacf5d5a198b2ff96696ce7055dd87b9a522a Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 25 Sep 2009 09:44:41 +0000 Subject: Change type to avoid void * arithmetic. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29716 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ve_lavc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmpcodecs/ve_lavc.c b/libmpcodecs/ve_lavc.c index 951941d585..66b6d100e4 100644 --- a/libmpcodecs/ve_lavc.c +++ b/libmpcodecs/ve_lavc.c @@ -331,7 +331,7 @@ static int config(struct vf_instance_s* vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt){ int size, i; - void *p; + char *p; mux_v->bih->biWidth=width; mux_v->bih->biHeight=height; -- cgit v1.2.3 From ac8b90aec199f44694fd539b92a6baf531d7b654 Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 25 Sep 2009 16:46:39 +0000 Subject: Do not override host_arch in x86 vs. x86_64 detection if it was forced via --target. Patch by Andrew Wason [rectalogic rectalo