diff -cNr MPlayer-0.60/configure MPlayer-0.60-jdo/configure *** MPlayer-0.60/configure Wed Jan 2 20:05:02 2002 --- MPlayer-0.60-jdo/configure Wed Jan 16 13:04:44 2002 *************** *** 149,154 **** --- 149,155 ---- --enable-xinerama build with Xinerama support for X11 [autodetect] --enable-x11 build with X11 render support [autodetect] --enable-fbdev build with FBDev render support [autodetect] + --enable-fbdev=nocopy yuv12 converts directly into framebuffer --enable-mlib build with MLIB support (Solaris only) [autodetect] --enable-3dfx build with 3dfx support [disable] --enable-tdfxfb build with tdfxfb support [disable] *************** *** 680,685 **** --- 681,687 ---- _aa=auto _svga=auto _fbdev=auto + _fbdev_nocopy=no _dvb=auto _dxr3=auto _iconv=auto *************** *** 754,759 **** --- 756,762 ---- --enable-svga) _svga=yes ;; --disable-svga) _svga=no ;; --enable-fbdev) _fbdev=yes ;; + --enable-fbdev=nocopy) _fbdev=yes; _fbdev_nocopy=yes ;; --disable-fbdev) _fbdev=no ;; --enable-dvb) _dvb=yes ;; --disable-dvb) _dvb=no ;; *************** *** 1242,1248 **** elif ( cc_check -pthread && $TMPO ) ; then _ld_pthread='-pthread' else ! die "Lib pthread not found. (needed by windows and networking stuff)" fi echores "yes (using $_ld_pthread)" --- 1245,1262 ---- elif ( cc_check -pthread && $TMPO ) ; then _ld_pthread='-pthread' else ! if test "$_ld_static" ; then ! # for crosscompilation, we cannot execute the program, be happy if we can link statically ! if ( cc_check -lpthread ) ; then ! _ld_pthread='-lpthread' ! elif ( cc_check -pthread ) ; then ! _ld_pthread='-pthread' ! else ! die "Static lib pthread not found. (needed by windows and networking stuff)" ! fi ! else ! die "Lib pthread not found. (needed by windows and networking stuff)" ! fi fi echores "yes (using $_ld_pthread)" *************** *** 1763,1774 **** --- 1777,1794 ---- _def_fbdev='#define HAVE_FBDEV 1' _vosrc="$_vosrc vo_fbdev.c" _vomodules="fbdev $_vomodules" + + if test "$_fbdev_nocopy" = yes ; then + _def_fbdev_nocopy='#define USE_CONVERT2FB 1' + fi else _def_fbdev='#undef HAVE_FBDEV' + _def_fbdev_nocopy='#undef USE_CONVERT2FB' fi echores "$_fbdev" + echocheck "DVB" if test "$_dvb" != no ; then _dvb=no *************** *** 3076,3081 **** --- 3096,3102 ---- $_def_xmga $_def_syncfb $_def_fbdev + $_def_fbdev_nocopy $_def_dxr3 $_def_dvb $_def_svga diff -cNr MPlayer-0.60/dec_audio.c MPlayer-0.60-jdo/dec_audio.c *** MPlayer-0.60/dec_audio.c Wed Jan 2 18:11:49 2002 --- MPlayer-0.60-jdo/dec_audio.c Wed Jan 16 11:08:58 2002 *************** *** 101,109 **** --- 101,114 ---- #ifdef USE_LIBMAD #include + + #define MAD_SINGLE_BUFFER_SIZE 8192 + #define MAD_TOTAL_BUFFER_SIZE ((MAD_SINGLE_BUFFER_SIZE)*3) + static struct mad_stream mad_stream; static struct mad_frame mad_frame; static struct mad_synth mad_synth; + static char* mad_in_buffer = 0; /* base pointer of buffer */ // ensure buffer is filled with some data static void mad_prepare_buffer(sh_audio_t* sh_audio, struct mad_stream* ms, int length) *************** *** 117,130 **** static void mad_postprocess_buffer(sh_audio_t* sh_audio, struct mad_stream* ms) { int delta = (unsigned char*)ms->next_frame - (unsigned char *)sh_audio->a_in_buffer; ! if(delta != 0) { sh_audio->a_in_buffer_len -= delta; memcpy(sh_audio->a_in_buffer, ms->next_frame, sh_audio->a_in_buffer_len); } } - static inline signed short mad_scale(mad_fixed_t sample) { --- 122,140 ---- static void mad_postprocess_buffer(sh_audio_t* sh_audio, struct mad_stream* ms) { + /* rotate buffer while possible, in order to reduce the overhead of endless memcpy */ int delta = (unsigned char*)ms->next_frame - (unsigned char *)sh_audio->a_in_buffer; ! if((unsigned long)(sh_audio->a_in_buffer) - (unsigned long)mad_in_buffer < ! (MAD_TOTAL_BUFFER_SIZE - MAD_SINGLE_BUFFER_SIZE - delta)) { ! sh_audio->a_in_buffer += delta; ! sh_audio->a_in_buffer_len -= delta; ! } else { ! sh_audio->a_in_buffer = mad_in_buffer; sh_audio->a_in_buffer_len -= delta; memcpy(sh_audio->a_in_buffer, ms->next_frame, sh_audio->a_in_buffer_len); } } static inline signed short mad_scale(mad_fixed_t sample) { *************** *** 449,457 **** case AFM_MAD: printf(__FILE__ ":%d:mad: setting minimum outputsize\n", __LINE__); sh_audio->audio_out_minsize=4608; ! if(sh_audio->audio_in_minsize<8192) sh_audio->audio_in_minsize=8192; sh_audio->a_in_buffer_size=sh_audio->audio_in_minsize; ! sh_audio->a_in_buffer=malloc(sh_audio->a_in_buffer_size); sh_audio->a_in_buffer_len=0; break; #endif --- 459,467 ---- case AFM_MAD: printf(__FILE__ ":%d:mad: setting minimum outputsize\n", __LINE__); sh_audio->audio_out_minsize=4608; ! if(sh_audio->audio_in_minsizeaudio_in_minsize=MAD_SINGLE_BUFFER_SIZE; sh_audio->a_in_buffer_size=sh_audio->audio_in_minsize; ! mad_in_buffer = sh_audio->a_in_buffer = malloc(MAD_TOTAL_BUFFER_SIZE); sh_audio->a_in_buffer_len=0; break; #endif diff -cNr MPlayer-0.60/libvo/vo_fbdev.c MPlayer-0.60-jdo/libvo/vo_fbdev.c *** MPlayer-0.60/libvo/vo_fbdev.c Tue Nov 6 12:21:08 2001 --- MPlayer-0.60-jdo/libvo/vo_fbdev.c Wed Jan 16 12:50:43 2002 *************** *** 1118,1125 **** static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, unsigned char *srca, int stride) { ! unsigned char *dst = next_frame + (in_width * y0 + x0) * fb_pixel_size; ! int dstride = in_width * fb_pixel_size; (*draw_alpha_p)(w, h, src, srca, stride, dst, dstride); } --- 1118,1137 ---- static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, unsigned char *srca, int stride) { ! unsigned char *dst; ! int dstride; ! ! #ifdef USE_CONVERT2FB ! if (pixel_format == IMGFMT_YV12) { ! dst = L123123875 + (fb_xres * y0 + x0) * fb_pixel_size; ! dstride = fb_xres * fb_pixel_size; ! } ! else ! #endif ! { ! dst = next_frame + (in_width * y0 + x0) * fb_pixel_size; ! dstride = in_width * fb_pixel_size; ! } (*draw_alpha_p)(w, h, src, srca, stride, dst, dstride); } *************** *** 1127,1135 **** --- 1139,1154 ---- static uint32_t draw_frame(uint8_t *src[]) { if (pixel_format == IMGFMT_YV12) { + #ifdef USE_CONVERT2FB + yuv2rgb(L123123875, src[0], src[1], src[2], fb_xres, + fb_yres, fb_xres * fb_pixel_size, + in_width, in_width / 2); + #else yuv2rgb(next_frame, src[0], src[1], src[2], in_width, in_height, in_width * fb_pixel_size, in_width, in_width / 2); + #endif + } else if (flip) { int h = in_height; int len = in_width * fb_pixel_size; *************** *** 1159,1164 **** --- 1178,1198 ---- { uint8_t *dest; + #ifdef USE_CONVERT2FB + if (pixel_format == IMGFMT_YV12) { + if(x < fb_xres && y < fb_yres) { + if(x+w > fb_xres) w= fb_xres-x; + if(y+h > fb_yres) h= fb_yres-y; + + dest = L123123875 + (fb_xres * y + x) * fb_pixel_size; + yuv2rgb(dest, src[0], src[1], src[2], w, h, fb_xres * fb_pixel_size, + stride[0], stride[1]); + } + + return 0; + } + #endif + dest = next_frame + (in_width * y + x) * fb_pixel_size; yuv2rgb(dest, src[0], src[1], src[2], w, h, in_width * fb_pixel_size, stride[0], stride[1]); *************** *** 1172,1177 **** --- 1206,1216 ---- static void put_frame(void) { int i, out_offset = 0, in_offset = 0; + + #ifdef USE_CONVERT2FB + if(pixel_format == IMGFMT_YV12) + return; + #endif for (i = 0; i < in_height; i++) { memcpy(L123123875 + out_offset, next_frame + in_offset,