[Mplayerxp-cvslog] SF.net SVN: mplayerxp:[103] mplayerxp
Brought to you by:
olov
From: <nic...@us...> - 2010-01-16 15:33:13
|
Revision: 103 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=103&view=rev Author: nickols_k Date: 2010-01-16 15:33:05 +0000 (Sat, 16 Jan 2010) Log Message: ----------- fixes Modified Paths: -------------- mplayerxp/dec_ahead.c mplayerxp/libmpcodecs/ad_mp3.c mplayerxp/libmpcodecs/dec_audio.c mplayerxp/libmpdemux/stheader.h mplayerxp/libvo/osd_template.c mplayerxp/libvo/sub.c mplayerxp/libvo/video_out.c mplayerxp/libvo/vo_null.c mplayerxp/libvo/vo_sdl.c mplayerxp/libvo/vo_x11.c mplayerxp/libvo/x11_common.c mplayerxp/mplayer.c Modified: mplayerxp/dec_ahead.c =================================================================== --- mplayerxp/dec_ahead.c 2010-01-15 18:37:16 UTC (rev 102) +++ mplayerxp/dec_ahead.c 2010-01-16 15:33:05 UTC (rev 103) @@ -622,7 +622,7 @@ int asize; unsigned o_bps; unsigned min_reserv; - o_bps=sh_audio->afilter_inited?sh_audio->f_bps:sh_audio->o_bps; + o_bps=sh_audio->afilter_inited?sh_audio->af_bps:sh_audio->o_bps; if(has_xp_video) asize = max(3*sha->audio_out_minsize,max(3*MAX_OUTBURST,o_bps*xp_num_frames/vo_fps))+MIN_BUFFER_RESERV; else asize = o_bps*ao_da_buffs; /* FIXME: get better indices from asize/real_audio_packet_size */ @@ -791,7 +791,7 @@ if(has_xp_video) { /* Match video buffer */ vbuf_size = abs_dec_ahead_locked_frame - abs_dec_ahead_active_frame; - pref_buf = vbuf_size / vo_fps * sh_audio->f_bps; + pref_buf = vbuf_size / vo_fps * sh_audio->af_bps; pref_buf -= len; if( pref_buf > 0 ) { len = min( pref_buf, free_buf ); @@ -817,7 +817,7 @@ struct timespec timeout; float d; int retval; - const float MAX_AUDIO_TIME = (float)ao_get_space() / sh_audio->f_bps + ao_get_delay(); + const float MAX_AUDIO_TIME = (float)ao_get_space() / sh_audio->af_bps + ao_get_delay(); float min_audio_time = MAX_AUDIO_TIME; float min_audio, max_audio; int samples, collect_samples; Modified: mplayerxp/libmpcodecs/ad_mp3.c =================================================================== --- mplayerxp/libmpcodecs/ad_mp3.c 2010-01-15 18:37:16 UTC (rev 102) +++ mplayerxp/libmpcodecs/ad_mp3.c 2010-01-16 15:33:05 UTC (rev 103) @@ -179,8 +179,6 @@ }; extern int fakemono; -static sh_audio_t* dec_audio_sh=NULL; - static void (*mpg123_init_ptr)(void); #define mpg123_init() (*mpg123_init_ptr)() static void (*mpg123_exit_ptr)(void); @@ -258,7 +256,6 @@ int err=0,nch,enc; unsigned char *indata; struct mpg123_frameinfo fi; - dec_audio_sh=sh; // save sh_audio for the callback: sh->samplesize=4; sh->sample_format=AFMT_FLOAT32; mpg123_init(); Modified: mplayerxp/libmpcodecs/dec_audio.c =================================================================== --- mplayerxp/libmpcodecs/dec_audio.c 2010-01-15 18:37:16 UTC (rev 102) +++ mplayerxp/libmpcodecs/dec_audio.c 2010-01-16 15:33:05 UTC (rev 103) @@ -32,14 +32,11 @@ static const ad_functions_t* mpadec; -static sh_audio_t *dec_audio_sh; - extern int force_srate; extern char *audio_codec; int init_audio(sh_audio_t *sh_audio) { unsigned i; - dec_audio_sh = sh_audio; for (i=0; mpcodecs_ad_drivers[i] != NULL; i++) if(strcmp(mpcodecs_ad_drivers[i]->info->driver_name,sh_audio->codec->driver_name)==0){ mpadec=mpcodecs_ad_drivers[i]; break; @@ -48,14 +45,14 @@ MSG_ERR(MSGTR_CODEC_BAD_AFAMILY,sh_audio->codec->codec_name, sh_audio->codec->driver_name); return 0; // no such driver } - + /* reset in/out buffer size/pointer: */ sh_audio->a_buffer_size=0; sh_audio->a_buffer=NULL; sh_audio->a_in_buffer_size=0; sh_audio->a_in_buffer=NULL; /* Set up some common usefull defaults. ad->preinit() can override these: */ - + sh_audio->samplesize=2; #ifdef WORDS_BIGENDIAN sh_audio->sample_format=AFMT_S16_BE; @@ -69,7 +66,7 @@ sh_audio->audio_out_minsize=8192;/* default size, maybe not enough for Win32/ACM*/ sh_audio->audio_in_minsize=0; - + if(!mpadec->preinit(sh_audio)) { MSG_ERR(MSGTR_CODEC_CANT_PREINITA); @@ -107,7 +104,7 @@ } sh_audio->inited=1; - + if(!sh_audio->channels || !sh_audio->samplerate){ MSG_WARN(MSGTR_UnknownAudio); uninit_audio(sh_audio); /* free buffers */ @@ -160,7 +157,7 @@ } /* Init audio filters */ -int preinit_audio_filters(sh_audio_t *sh_audio, +int preinit_audio_filters(sh_audio_t *sh_audio, int in_samplerate, int in_channels, int in_format, int in_bps, int* out_samplerate, int* out_channels, int* out_format, int out_bps){ char strbuf[200]; @@ -180,28 +177,28 @@ afs->output.format = afs->input.format; afs->output.bps = out_bps ? out_bps : afs->input.bps; } - // filter config: + // filter config: memcpy(&afs->cfg,&af_cfg,sizeof(af_cfg_t)); - + MSG_V("Checking audio filter chain for %dHz/%dch/%dbit...\n", afs->input.rate,afs->input.nch,afs->input.bps*8); - + // let's autoprobe it! if(0 != af_init(afs,0)){ free(afs); return 0; // failed :( } - + *out_samplerate=afs->output.rate; *out_channels=afs->output.nch; *out_format=af_format_encode((void*)(&afs->output)); - sh_audio->f_bps = afs->output.rate*afs->output.nch*afs->output.bps; - + sh_audio->af_bps = afs->output.rate*afs->output.nch*afs->output.bps; + MSG_V("AF_pre: af format: %d bps, %d ch, %d hz, %s\n", afs->output.bps, afs->output.nch, afs->output.rate, fmt2str(afs->output.format,afs->output.bps,strbuf,200)); - + sh_audio->afilter=(void*)afs; return 1; } @@ -226,23 +223,23 @@ // filter config: memcpy(&afs->cfg,&af_cfg,sizeof(af_cfg_t)); - + MSG_V("Building audio filter chain for %dHz/%dch/%dbit (%s) -> %dHz/%dch/%dbit (%s)...\n", afs->input.rate,afs->input.nch,afs->input.bps*8,ao_format_name(af_format_encode(&afs->input)), afs->output.rate,afs->output.nch,afs->output.bps*8,ao_format_name(af_format_encode(&afs->output))); - + // let's autoprobe it! if(0 != af_init(afs,1)){ sh_audio->afilter=NULL; free(afs); return 0; // failed :( } - + // allocate the a_out_* buffers: if(out_maxsize<out_minsize) out_maxsize=out_minsize; if(out_maxsize<8192) out_maxsize=MAX_OUTBURST; // not sure this is ok - sh_audio->f_bps = afs->output.rate*afs->output.nch*afs->output.bps; + sh_audio->af_bps = afs->output.rate*afs->output.nch*afs->output.bps; sh_audio->a_buffer_size=out_maxsize; sh_audio->a_buffer=malloc(sh_audio->a_buffer_size); @@ -282,29 +279,29 @@ if(!sh_audio->inited) return -1; // no codec MSG_DBG3("decode_audio(%p,%p,%i,%i,%i,%p)\n",sh_audio,buf,minlen,maxlen,buflen,pts); - + if(minlen>maxlen) MSG_WARN(MSGTR_CODEC_XP_INT_ERR,minlen,maxlen); - if(sh_audio->f_buffer_len) + if(sh_audio->af_buffer_len) { - cp_size=min(buflen,sh_audio->f_buffer_len); - memcpy(buf,sh_audio->f_buffer,cp_size); - *pts = sh_audio->f_pts; - cp_tile=sh_audio->f_buffer_len-cp_size; - MSG_DBG2("cache->buf %i bytes %f pts <PREDICTED PTS %f>\n",cp_size,*pts,*pts+(float)cp_tile/(float)sh_audio->f_bps); + cp_size=min(buflen,sh_audio->af_buffer_len); + memcpy(buf,sh_audio->af_buffer,cp_size); + *pts = sh_audio->af_pts; + cp_tile=sh_audio->af_buffer_len-cp_size; + MSG_DBG2("cache->buf %i bytes %f pts <PREDICTED PTS %f>\n",cp_size,*pts,*pts+(float)cp_tile/(float)sh_audio->af_bps); if(cp_tile) { - sh_audio->f_buffer=&sh_audio->f_buffer[cp_size]; - sh_audio->f_buffer_len=cp_tile; - sh_audio->f_pts += (float)cp_size/(float)sh_audio->f_bps; + sh_audio->af_buffer=&sh_audio->af_buffer[cp_size]; + sh_audio->af_buffer_len=cp_tile; + sh_audio->af_pts += (float)cp_size/(float)sh_audio->af_bps; } - else sh_audio->f_buffer_len=0; + else sh_audio->af_buffer_len=0; return cp_size; } - if(sh_audio->f_bps>sh_audio->o_bps) - maxlen=min(maxlen,(long long int)buflen*sh_audio->o_bps/sh_audio->f_bps); + if(sh_audio->af_bps>sh_audio->o_bps) + maxlen=min(maxlen,(long long int)buflen*sh_audio->o_bps/sh_audio->af_bps); len=mpadec->decode_audio(sh_audio,buf, minlen, maxlen,pts); if(len>buflen) MSG_WARN(MSGTR_CODEC_BUF_OVERFLOW,sh_audio->codec->driver_name,len,buflen); - MSG_DBG2("decaudio: %i bytes %f pts min %i max %i buflen %i o_bps=%i f_bps=%i\n",len,*pts,minlen,maxlen,buflen,sh_audio->o_bps,sh_audio->f_bps); + MSG_DBG2("decaudio: %i bytes %f pts min %i max %i buflen %i o_bps=%i f_bps=%i\n",len,*pts,minlen,maxlen,buflen,sh_audio->o_bps,sh_audio->af_bps); if(len<=0 || !sh_audio->afilter) return len; // EOF? // run the filters: afd.audio=buf; @@ -330,12 +327,12 @@ cp_tile=pafd->len-cp_size; if(cp_tile) { - sh_audio->f_buffer=&((char *)pafd->audio)[cp_size]; - sh_audio->f_buffer_len=cp_tile; - sh_audio->f_pts = *pts+(float)cp_size/(float)sh_audio->f_bps; + sh_audio->af_buffer=&((char *)pafd->audio)[cp_size]; + sh_audio->af_buffer_len=cp_tile; + sh_audio->af_pts = *pts+(float)cp_size/(float)sh_audio->af_bps; MSG_DBG2("decaudio: afilter->cache %i bytes %f pts\n",cp_tile,*pts); } - else sh_audio->f_buffer_len=0; + else sh_audio->af_buffer_len=0; } return cp_size; } Modified: mplayerxp/libmpdemux/stheader.h =================================================================== --- mplayerxp/libmpdemux/stheader.h 2010-01-15 18:37:16 UTC (rev 102) +++ mplayerxp/libmpdemux/stheader.h 2010-01-16 15:33:05 UTC (rev 103) @@ -17,28 +17,28 @@ int inited; // output format: float timer; // value of old a_frame - int samplerate; - int samplesize; - int channels; - int o_bps; // == samplerate*samplesize*channels (uncompr. bytes/sec) - int i_bps; // == bitrate (compressed bytes/sec) + unsigned samplerate; + unsigned samplesize; + unsigned channels; + unsigned o_bps; // == samplerate*samplesize*channels (uncompr. bytes/sec) + unsigned i_bps; // == bitrate (compressed bytes/sec) // in buffers: char* a_in_buffer; int a_in_buffer_len; - int a_in_buffer_size; + unsigned a_in_buffer_size; // out buffers: char* a_buffer; int a_buffer_len; - int a_buffer_size; + unsigned a_buffer_size; - /* filter buffer */ + /* filter buffer */ void * afilter; int afilter_inited; - unsigned f_bps; // == samplerate*samplesize*channels (after filters bytes/sec) - char * f_buffer; - unsigned f_buffer_len; - float f_pts; + unsigned af_bps; // == samplerate*samplesize*channels (after filters bytes/sec) + char * af_buffer; + unsigned af_buffer_len; + float af_pts; int sample_format; float a_pts; @@ -48,12 +48,12 @@ AVIStreamHeader audio; WAVEFORMATEX *wf; // char wf_ext[64]; // in format - int audio_in_minsize; - int audio_out_minsize; + unsigned audio_in_minsize; + unsigned audio_out_minsize; // other codecs: void* context; // codec-specific stuff (usually HANDLE or struct pointer) unsigned char *codecdata; - int codecdata_len; + unsigned codecdata_len; } sh_audio_t; typedef struct { @@ -68,18 +68,18 @@ float fps; float frametime; // 1/fps int chapter_change; - int i_bps; // == bitrate (compressed bytes/sec) - int disp_w,disp_h; // display size (filled by fileformat parser) + unsigned i_bps; // == bitrate (compressed bytes/sec) + unsigned disp_w,disp_h;// display size (filled by fileformat parser) // int coded_w,coded_h; // coded size (filled by video codec) float aspect; unsigned int outfmtidx; - + void *vfilter; int vfilter_inited; // unsigned int bitrate; // buffers: float num_frames; // number of frames played - int num_frames_decoded; // number of frames decoded + int num_frames_decoded; // number of frames decoded mp_image_t *image; // win32 codec stuff: AVIStreamHeader video; Modified: mplayerxp/libvo/osd_template.c =================================================================== --- mplayerxp/libvo/osd_template.c 2010-01-15 18:37:16 UTC (rev 102) +++ mplayerxp/libvo/osd_template.c 2010-01-16 15:33:05 UTC (rev 103) @@ -57,20 +57,27 @@ #endif PROFILE_START(); for(y=0;y<(unsigned)h;y++){ - register int x=0; + int x; + x=0; #ifdef HAVE_INT_PVECTOR _ivec_prefetchw(&dstbase[x]); _ivec_prefetch(&src[x]); _ivec_prefetch(&srca[x]); - if(w>=__IVEC_SIZE) + /* MOVNTDQ: #GP(0) - If memory operand is not aligned on a 16-byte boundary */ + for(;x<w;x++){ + unsigned char *dst=&dstbase[x]; + if(srca[x]) *dst=((dstbase[x]*srca[x])>>8)+src[x]; + if((((long)dst)&(__IVEC_SIZE-1))==0) break; /* align on sizeof(MMREG) boundary */ + } + if((w-x)>=__IVEC_SIZE) for(;x<w;x+=__IVEC_SIZE){ __ivec vmsk,vdest,vsrc,vsrca,vt[4]; _ivec_prefetchw(&dstbase[x+__IVEC_SIZE*4]); _ivec_prefetch(&src[x+__IVEC_SIZE*4]); _ivec_prefetch(&srca[x+__IVEC_SIZE*4]); - vdest = _ivec_loadu(&dstbase[x]); - vsrc = _ivec_loada(&src[x]); - vsrca = _ivec_loada(&srca[x]); + vdest = _ivec_loada(&dstbase[x]); + vsrc = _ivec_loadu(&src[x]); + vsrca = _ivec_loadu(&srca[x]); vmsk = _ivec_not(_ivec_cmpeq_s8(vsrca,vzero)); vt[0] = _ivec_u16_from_lou8(vdest); vt[1] = _ivec_u16_from_hiu8(vdest); @@ -82,12 +89,12 @@ _ivec_stream(&dstbase[x],_ivec_blend_u8(vdest,vt[0],vmsk)); } #endif - for(;x<w;x++){ - if(srca[x]) dstbase[x]=((dstbase[x]*srca[x])>>8)+src[x]; - } - src+=srcstride; - srca+=srcstride; - dstbase+=dststride; + for(;x<w;x++){ + if(srca[x]) dstbase[x]=((dstbase[x]*srca[x])>>8)+src[x]; + } + src+=srcstride; + srca+=srcstride; + dstbase+=dststride; } #ifdef HAVE_INT_PVECTOR _ivec_empty(); Modified: mplayerxp/libvo/sub.c =================================================================== --- mplayerxp/libvo/sub.c 2010-01-15 18:37:16 UTC (rev 102) +++ mplayerxp/libvo/sub.c 2010-01-16 15:33:05 UTC (rev 103) @@ -138,7 +138,7 @@ inline static void __FASTCALL__ vo_draw_text_osd(mp_osd_obj_t* obj,draw_osd_f draw_alpha){ unsigned char *cp=(unsigned char *)vo_osd_text; - int font; + int font; int x=obj->x; while (*cp){ Modified: mplayerxp/libvo/video_out.c =================================================================== --- mplayerxp/libvo/video_out.c 2010-01-15 18:37:16 UTC (rev 102) +++ mplayerxp/libvo/video_out.c 2010-01-16 15:33:05 UTC (rev 103) @@ -897,7 +897,7 @@ if(x0+w<=dri_cap.width&&y0+h<=dri_cap.height) { if(!draw_alpha) draw_alpha=get_draw_alpha(dri_cap.fourcc); - if(draw_alpha) + if(draw_alpha) (*draw_alpha)(w,h,src,srca,stride, dri_surf[active_frame].planes[0]+dri_cap.strides[0]*y0+x0*((dri_bpp+7)/8), dri_cap.strides[0]); Modified: mplayerxp/libvo/vo_null.c =================================================================== --- mplayerxp/libvo/vo_null.c 2010-01-15 18:37:16 UTC (rev 102) +++ mplayerxp/libvo/vo_null.c 2010-01-16 15:33:05 UTC (rev 103) @@ -183,7 +183,7 @@ static uint32_t __FASTCALL__ preinit(const char *arg) { - if(arg) + if(arg) { MSG_ERR("vo_null: Unknown subdevice: %s\n",arg); return ENOSYS; @@ -193,9 +193,9 @@ static void __FASTCALL__ null_dri_get_surface_caps(dri_surface_cap_t *caps) { - caps->caps = DRI_CAP_TEMP_VIDEO; - caps->caps |= DRI_CAP_HORZSCALER | DRI_CAP_VERTSCALER; - caps->caps |= DRI_CAP_DOWNSCALER | DRI_CAP_UPSCALER; + caps->caps =DRI_CAP_TEMP_VIDEO | + DRI_CAP_HORZSCALER | DRI_CAP_VERTSCALER | + DRI_CAP_DOWNSCALER | DRI_CAP_UPSCALER; caps->fourcc = null_fourcc; caps->width=null_image_width; caps->height=null_image_height; @@ -217,18 +217,63 @@ surf->planes[3] = 0; } +static int __FASTCALL__ null_query_format(vo_query_fourcc_t* format) { + /* we must avoid compressed-fourcc here */ + switch(format->fourcc) { + case IMGFMT_444P16_LE: + case IMGFMT_444P16_BE: + case IMGFMT_422P16_LE: + case IMGFMT_422P16_BE: + case IMGFMT_420P16_LE: + case IMGFMT_420P16_BE: + case IMGFMT_420A: + case IMGFMT_444P: + case IMGFMT_422P: + case IMGFMT_YV12: + case IMGFMT_I420: + case IMGFMT_IYUV: + case IMGFMT_YVU9: + case IMGFMT_IF09: + case IMGFMT_411P: + case IMGFMT_YUY2: + case IMGFMT_UYVY: +// RGB and grayscale (Y8 and Y800): + case IMGFMT_RGB48LE: + case IMGFMT_RGB48BE: + case IMGFMT_BGR32: + case IMGFMT_RGB32: + case IMGFMT_BGR24: + case IMGFMT_RGB24: + case IMGFMT_BGR16: + case IMGFMT_RGB16: + case IMGFMT_BGR15: + case IMGFMT_RGB15: + case IMGFMT_Y800: + case IMGFMT_Y8: + case IMGFMT_BGR8: + case IMGFMT_RGB8: + case IMGFMT_BGR4: + case IMGFMT_RGB4: + case IMGFMT_BG4B: + case IMGFMT_RG4B: + case IMGFMT_BGR1: + case IMGFMT_RGB1: return VO_TRUE; + } + return VO_FALSE; +} + static uint32_t __FASTCALL__ control(uint32_t request, void *data) { switch (request) { case VOCTRL_QUERY_FORMAT: - return VO_TRUE; + return null_query_format(data); case VOCTRL_GET_NUM_FRAMES: *(uint32_t *)data = null_num_frames; return VO_TRUE; case DRI_GET_SURFACE_CAPS: null_dri_get_surface_caps(data); return VO_TRUE; - case DRI_GET_SURFACE: + case DRI_GET_SURFACE: null_dri_get_surface(data); return VO_TRUE; case VOCTRL_FLUSH_PAGES: Modified: mplayerxp/libvo/vo_sdl.c =================================================================== --- mplayerxp/libvo/vo_sdl.c 2010-01-15 18:37:16 UTC (rev 102) +++ mplayerxp/libvo/vo_sdl.c 2010-01-16 15:33:05 UTC (rev 103) @@ -26,22 +26,22 @@ * at http://slouken.devolution.com/SDL/ * * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. - * + * * mpeg2dec is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * mpeg2dec is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with GNU Make; see the file COPYING. If not, write to * the Free Software Foundation. * - * -- end old disclaimer -- + * -- end old disclaimer -- * * Changes: * Dominik Schnitzer <do...@sc...> - November 08, 2000. @@ -136,7 +136,7 @@ int sdl_forcexv; int sdl_forcegl; -static vo_info_t vo_info = +static vo_info_t vo_info = { "SDL YUV/RGB/BGR renderer (SDL v1.1.7+ !)" #ifdef CONFIG_VIDIX @@ -174,7 +174,7 @@ #define FS 0x01 #define VM 0x02 #define ZOOM 0x04 -#define FLIP 0x08 +#define FLIP 0x08 #ifdef SDL_ENABLE_LOCKS #define SDL_OVR_LOCK(x) if (SDL_LockYUVOverlay (priv->overlay[x])) { \ @@ -266,7 +266,7 @@ /* 1 if the OSD has changed otherwise 0 */ int osd_has_changed; - + /* source image format (YUV/RGB/...) */ uint32_t format; @@ -311,10 +311,10 @@ * Open and prepare SDL output. * * params : *plugin == - * *name == + * *name == * returns : 0 on success, -1 on failure **/ - + static int sdl_open ( void ) { struct sdl_priv_s *priv = &sdl_priv; @@ -393,7 +393,7 @@ /* non hardware accelerated fullscreen modes */ priv->sdlfullflags &= ~SDL_HWSURFACE; - priv->fullmodes = SDL_ListModes (vidInfo->vfmt, priv->sdlfullflags); + priv->fullmodes = SDL_ListModes (vidInfo->vfmt, priv->sdlfullflags); } /* test for normal resizeable & windowed hardware accellerated surfaces */ @@ -557,14 +557,14 @@ /* if creation of new surface was successfull, save it and hide mouse cursor */ if(newsurface) { if (priv->surface) - SDL_FreeSurface(priv->surface); + SDL_FreeSurface(priv->surface); priv->surface = newsurface; SDL_ShowCursor(0); SDL_SRF_LOCK(priv->surface, -1) SDL_FillRect(priv->surface, NULL, 0); SDL_SRF_UNLOCK(priv->surface) retval = setup_surfaces(); - } + } else MSG_ERR("set_fullmode: SDL_SetVideoMode failed: %s\n", SDL_GetError()); return retval; @@ -618,7 +618,7 @@ MSG_V("SDL: Using 0x%X (%s) image format\n", format, vo_format_name(format)); - + if(priv->mode != YUV) { priv->sdlflags |= SDL_ANYFORMAT; priv->sdlfullflags |= SDL_ANYFORMAT; @@ -700,10 +700,10 @@ aspect_save_screenres(priv->XWidth,priv->XHeight); aspect(&priv->dstwidth,&priv->dstheight,flags&VOFLAG_SWSCALE?A_ZOOM:A_NOZOOM); } - + priv->windowsize.w = priv->dstwidth; - priv->windowsize.h = priv->dstheight; - + priv->windowsize.h = priv->dstheight; + /* bit 0 (0x01) means fullscreen (-fs) * bit 1 (0x02) means mode switching (-vm) * bit 2 (0x04) enables software scaling (-zoom) @@ -719,7 +719,7 @@ priv->fulltype = FS; retval = set_fullmode(priv->fullmode); if(retval) return retval; - } else + } else if(flags&VM) { MSG_V("SDL: setting zoomed fullscreen with modeswitching\n"); priv->fulltype = VM; @@ -730,7 +730,7 @@ priv->fulltype = ZOOM; retval = set_fullmode(priv->fullmode); if(retval) return retval; - } + } else { if((strcmp(priv->driver, "x11") == 0) ||(strcmp(priv->driver, "windib") == 0) @@ -945,9 +945,9 @@ } break; case SDL_KEYUP: -#else +#else case SDL_KEYDOWN: -#endif +#endif keypressed = event.key.keysym.sym; MSG_V("SDL: Key pressed: '%i'\n", keypressed); @@ -963,9 +963,9 @@ } else if ( keypressed == SDLK_n ) { -#ifdef HAVE_X11 +#ifdef HAVE_X11 aspect(&priv->dstwidth, &priv->dstheight,softzoom?A_ZOOM:A_NOZOOM); -#endif +#endif if (priv->surface->w != priv->dstwidth || priv->surface->h != priv->dstheight) { if(enable_xp) LOCK_VDECODING(); if(set_video_mode(priv->dstwidth, priv->dstheight, priv->bpp, priv->sdlflags)!=0) exit(EXIT_FAILURE); @@ -1028,7 +1028,7 @@ default: mplayer_put_key(keypressed); } - + break; case SDL_QUIT: SDL_ShowCursor(1); @@ -1048,12 +1048,12 @@ struct sdl_priv_s *priv = &sdl_priv; switch(priv->format) { - case IMGFMT_YV12: + case IMGFMT_YV12: case IMGFMT_I420: case IMGFMT_IYUV: { SDL_OVR_LOCK(idx) - + /* Erase Y plane */ erase_area_1(x, w, h, priv->overlay[idx]->pitches[0], 0, @@ -1064,12 +1064,12 @@ x /= 2; h /= 2; y /= 2; - + erase_area_1(x, w, h, priv->overlay[idx]->pitches[1], 128, priv->overlay[idx]->pixels[1] + priv->overlay[idx]->pitches[1]*y); - + erase_area_1(x, w, h, priv->overlay[idx]->pitches[2], 128, priv->overlay[idx]->pixels[2] + @@ -1096,7 +1096,7 @@ SDL_OVR_UNLOCK(idx) break; } - + case IMGFMT_RGB15: case IMGFMT_BGR15: case IMGFMT_RGB16: @@ -1126,7 +1126,7 @@ int x_end = x_start/4 + width/4; int x, y; uint32_t* data = (uint32_t*) pixels; - + x_start /= 4; pitch /= 4; @@ -1255,11 +1255,11 @@ static uint32_t __FASTCALL__ preinit(const char *arg) { struct sdl_priv_s *priv = &sdl_priv; -#ifdef HAVE_X11 +#ifdef HAVE_X11 static Display *XDisplay; static int XScreen; #endif - + memset(priv,0,sizeof(sdl_priv)); memset(priv->rgbsurface,0,sizeof(priv->rgbsurface)); memset(priv->overlay,0,sizeof(priv->overlay)); priv->num_buffs = 1; @@ -1301,7 +1301,7 @@ caps->w=priv->width; caps->h=priv->height; if(priv->mode == YUV) { - if(priv->overlay) + if(priv->overlay[0]) { int i,n; caps->width=priv->overlay[0]->w; @@ -1322,7 +1322,7 @@ } else { - if(priv->rgbsurface) + if(priv->rgbsurface[0]) { caps->width=priv->rgbsurface[0]->w; caps->height=priv->rgbsurface[0]->h; @@ -1375,7 +1375,7 @@ case DRI_GET_SURFACE_CAPS: sdl_dri_get_surface_caps(data); return VO_TRUE; - case DRI_GET_SURFACE: + case DRI_GET_SURFACE: sdl_dri_get_surface(data); return VO_TRUE; case VOCTRL_CHECK_EVENTS: Modified: mplayerxp/libvo/vo_x11.c =================================================================== --- mplayerxp/libvo/vo_x11.c 2010-01-15 18:37:16 UTC (rev 102) +++ mplayerxp/libvo/vo_x11.c 2010-01-16 15:33:05 UTC (rev 103) @@ -138,13 +138,13 @@ title = strdup("MPlayerXP X11 (XImage/Shm) render"); in_format=format; - + if( flags&0x03 ) fullscreen = 1; if( flags&0x02 ) vm = 1; if( flags&0x08 ) Flip_Flag = 1; zoomFlag = flags&0x04; // if(!fullscreen) zoomFlag=1; //it makes no sense to avoid zooming on windowd mode - + XGetWindowAttributes( mDisplay,DefaultRootWindow( mDisplay ),&attribs ); depth=attribs.depth; Modified: mplayerxp/libvo/x11_common.c =================================================================== --- mplayerxp/libvo/x11_common.c 2010-01-15 18:37:16 UTC (rev 102) +++ mplayerxp/libvo/x11_common.c 2010-01-16 15:33:05 UTC (rev 103) @@ -375,7 +375,7 @@ vo_screenwidth,vo_screenheight, depth, vo_depthonscreen, dispName,mLocalDisplay?"local":"remote"); - + return 1; } Modified: mplayerxp/mplayer.c =================================================================== --- mplayerxp/mplayer.c 2010-01-15 18:37:16 UTC (rev 102) +++ mplayerxp/mplayer.c 2010-01-16 15:33:05 UTC (rev 103) @@ -99,7 +99,7 @@ #include "dec_ahead.h" int enable_xp=XP_VAPlay; -int enable_gomp=1; +int enable_gomp=0; /* currently it's experimental feature */ volatile int dec_ahead_active_frame=0; volatile unsigned abs_dec_ahead_active_frame=0; volatile unsigned loc_dec_ahead_active_frame=0; @@ -474,7 +474,7 @@ if( audio_buffer.indices[audio_buffer.index_tail].index != audio_buffer.tail ) { int buff_len = audio_buffer.len; MSG_DBG3("audio_ahead: orig idx %3i pts %.3f pos %i \n",audio_buffer.index_tail, audio_buffer.indices[audio_buffer.index_tail].pts,audio_buffer.indices[audio_buffer.index_tail].index ); - audio_buffer.indices[audio_buffer.index_tail].pts += (float)((audio_buffer.tail - audio_buffer.indices[audio_buffer.index_tail].index + buff_len) % buff_len) / (float)audio_buffer.sh_audio->f_bps; + audio_buffer.indices[audio_buffer.index_tail].pts += (float)((audio_buffer.tail - audio_buffer.indices[audio_buffer.index_tail].index + buff_len) % buff_len) / (float)audio_buffer.sh_audio->af_bps; audio_buffer.indices[audio_buffer.index_tail].index = audio_buffer.tail; MSG_DBG3("audio_ahead: read next_idx %3i next_pts %.3f pos %i \n", audio_buffer.index_tail,audio_buffer.indices[audio_buffer.index_tail].pts,audio_buffer.indices[audio_buffer.index_tail].index ); } @@ -490,7 +490,7 @@ int delay = audio_buffer.head - audio_buffer.tail; if( delay < 0 ) delay += audio_buffer.len; - return (float)delay / (float)audio_buffer.sh_audio->f_bps; + return (float)delay / (float)audio_buffer.sh_audio->af_bps; } int decode_audio_buffer(int len) @@ -1102,29 +1102,29 @@ if(use_pts_fix2) { if(sh_audio->a_pts != HUGE) { sh_audio->a_pts_pos-=playsize; - if(sh_audio->a_pts_pos > -ao_get_delay()*sh_audio->f_bps) { - sh_audio->timer+=playsize/(float)(sh_audio->f_bps); + if(sh_audio->a_pts_pos > -ao_get_delay()*sh_audio->af_bps) { + sh_audio->timer+=playsize/(float)(sh_audio->af_bps); } else { - sh_audio->timer=sh_audio->a_pts-(float)sh_audio->a_pts_pos/(float)sh_audio->f_bps; + sh_audio->timer=sh_audio->a_pts-(float)sh_audio->a_pts_pos/(float)sh_audio->af_bps; MSG_V("Audio chapter change detected\n"); sh_audio->chapter_change=1; sh_audio->a_pts = HUGE; } } else if(pts != HUGE) { if(pts < 1.0 && sh_audio->timer > 2.0) { - sh_audio->timer+=playsize/(float)(sh_audio->f_bps); + sh_audio->timer+=playsize/(float)(sh_audio->af_bps); sh_audio->a_pts=pts; sh_audio->a_pts_pos=sh_audio->a_buffer_len-ret; } else { - sh_audio->timer=pts+(ret-sh_audio->a_buffer_len)/(float)(sh_audio->f_bps); + sh_audio->timer=pts+(ret-sh_audio->a_buffer_len)/(float)(sh_audio->af_bps); sh_audio->a_pts=HUGE; } } else - sh_audio->timer+=playsize/(float)(sh_audio->f_bps); + sh_audio->timer+=playsize/(float)(sh_audio->af_bps); } else if(av_sync_pts && pts!=HUGE) - sh_audio->timer=pts+(ret-sh_audio->a_buffer_len)/(float)(sh_audio->f_bps); + sh_audio->timer=pts+(ret-sh_audio->a_buffer_len)/(float)(sh_audio->af_bps); else - sh_audio->timer+=playsize/(float)(sh_audio->f_bps); + sh_audio->timer+=playsize/(float)(sh_audio->af_bps); if(!av_sync_pts && enable_xp>=XP_VAPlay) pthread_mutex_unlock(&audio_timer_mutex); } @@ -1349,8 +1349,8 @@ /* DaP's AV-sync */ float SH_AV_delay; - /* SH_AV_delay = sh_video->timer - (sh_audio->timer - (float)((float)delay + sh_audio->a_buffer_len) / (float)sh_audio->f_bps); */ - SH_AV_delay = sh_video->timer - (sh_audio->timer - (float)((float)delay) / (float)sh_audio->f_bps); + /* SH_AV_delay = sh_video->timer - (sh_audio->timer - (float)((float)delay + sh_audio->a_buffer_len) / (float)sh_audio->af_bps); */ + SH_AV_delay = sh_video->timer - (sh_audio->timer - (float)((float)delay) / (float)sh_audio->af_bps); if(SH_AV_delay<-2*frame_time){ static int drop_message=0; drop_frame=frame_dropping; // tricky! @@ -1462,11 +1462,11 @@ float a_pts=0; // unplayed bytes in our and soundcard/dma buffer: - float delay=ao_get_delay()+(float)sh_audio->a_buffer_len/(float)sh_audio->f_bps; + float delay=ao_get_delay()+(float)sh_audio->a_buffer_len/(float)sh_audio->af_bps; if(pts_from_bps){ // PTS = sample_no / samplerate - unsigned int samples=(sh_audio->audio.dwSampleSize)? + unsigned int samples=(sh_audio->audio.dwSampleSize)? ((ds_tell(d_audio)-sh_audio->a_in_buffer_len)/sh_audio->audio.dwSampleSize) : (d_audio->pack_no); // <- used for VBR audio samples+=sh_audio->audio.dwStart; // offset @@ -1732,7 +1732,7 @@ float a_pts=0; // unplayed bytes in our and soundcard/dma buffer: - float delay=ao_get_delay()+(float)sh_audio->a_buffer_len/(float)sh_audio->f_bps; + float delay=ao_get_delay()+(float)sh_audio->a_buffer_len/(float)sh_audio->af_bps; if(enable_xp>=XP_VideoAudio) delay += get_delay_audio_buffer(); @@ -2614,7 +2614,7 @@ sh_audio=d_audio->sh=NULL; } else { MSG_V("AUDIO: srate=%d chans=%d bps=%d sfmt=0x%X ratio: %d->%d\n",sh_audio->samplerate,sh_audio->channels,sh_audio->samplesize, - sh_audio->sample_format,sh_audio->i_bps,sh_audio->f_bps); + sh_audio->sample_format,sh_audio->i_bps,sh_audio->af_bps); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |