[Mplayerxp-cvslog] SF.net SVN: mplayerxp:[440] mplayerxp
Brought to you by:
olov
From: <nic...@us...> - 2012-11-23 10:54:04
|
Revision: 440 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=440&view=rev Author: nickols_k Date: 2012-11-23 10:53:52 +0000 (Fri, 23 Nov 2012) Log Message: ----------- security patch: remove suspect and ancient keys. Best protection from context substitution is unavalability of one Modified Paths: -------------- mplayerxp/cfg-mplayerxp.h mplayerxp/libmpdemux/demux_avi.cpp mplayerxp/libmpdemux/demuxer.cpp mplayerxp/libmpdemux/demuxer.h mplayerxp/libvo/video_out.cpp mplayerxp/libvo/video_out.h mplayerxp/libvo/vo_opengl.cpp mplayerxp/libvo/vo_x11.cpp mplayerxp/libvo/vo_xv.cpp mplayerxp/libvo/x11_common.cpp mplayerxp/mplayerxp.cpp mplayerxp/xmpcore/xmp_vplayer.cpp Modified: mplayerxp/cfg-mplayerxp.h =================================================================== --- mplayerxp/cfg-mplayerxp.h 2012-11-23 10:26:17 UTC (rev 439) +++ mplayerxp/cfg-mplayerxp.h 2012-11-23 10:53:52 UTC (rev 440) @@ -170,8 +170,6 @@ #ifdef HAVE_X11 static const config_t x11_config[]={ {"display", &vo_conf.mDisplayName, CONF_TYPE_STRING, 0, 0, 0, "specifies the hostname and display number of the X server"}, - {"wid", &vo_conf.WinID, CONF_TYPE_INT, 0, 0, 0, "tells MPlayerXP to use existing X11 window (for using MPlayerXP as plugin)"}, - {"rootwin", &vo_conf.WinID, CONF_TYPE_FLAG, 0, -1, 0, "render movie in the root window (desktop background)"}, #ifdef HAVE_XINERAMA {"xinerama", &mp_conf.xinerama_screen, CONF_TYPE_INT, CONF_RANGE, 0, 32, "tells MPlayerXP the display for movie playback"}, #endif Modified: mplayerxp/libmpdemux/demux_avi.cpp =================================================================== --- mplayerxp/libmpdemux/demux_avi.cpp 2012-11-23 10:26:17 UTC (rev 439) +++ mplayerxp/libmpdemux/demux_avi.cpp 2012-11-23 10:53:52 UTC (rev 440) @@ -753,9 +753,6 @@ } #undef MIN -// PTS: 0=interleaved 1=BPS-based -int pts_from_bps=1; - // Select ds from ID static demux_stream_t* demux_avi_select_stream(demuxer_t *demux,unsigned int id){ int stream_id=avi_stream_id(id); @@ -856,12 +853,7 @@ } else priv->pts_corr_bytes+=len; } - if(pts_from_bps){ - pts = priv->audio_block_no * - (float)((sh_audio_t*)demux->audio->sh)->audio.dwScale / - (float)((sh_audio_t*)demux->audio->sh)->audio.dwRate; - } else - pts=priv->avi_audio_pts; //+priv->pts_correction; + pts=priv->avi_audio_pts; //+priv->pts_correction; priv->avi_audio_pts=0; // update blockcount: priv->audio_block_no+=priv->audio_block_size ? @@ -905,7 +897,6 @@ static int avi_read_ni(demuxer_t *demux,demux_stream_t* ds); static int avi_read_nini(demuxer_t *demux,demux_stream_t* ds); -int force_ni=0; // force non-interleaved AVI parsing static int avi_demux(demuxer_t *demux,demux_stream_t *__ds){ avi_priv_t *priv=reinterpret_cast<avi_priv_t*>(demux->priv); if(priv->alt_demuxer) return priv->alt_demuxer(demux,__ds); @@ -1128,13 +1119,6 @@ return 1; } -//extern int audio_id; -//extern int video_id; -//extern int index_mode; // -1=untouched 0=don't use index 1=use (geneate) index -//extern int force_ni; -//extern int pts_from_bps; - -// AVI demuxer parameters: int index_mode=-1; // -1=untouched 0=don't use index 1=use (geneate) index extern demuxer_t* init_avi_with_ogg(demuxer_t* demuxer); extern demuxer_driver_t demux_ogg; @@ -1211,19 +1195,8 @@ if(a_pos==-1){ MSG_ERR("AVI_NI: " MSGTR_MissingAudioStream); sh_audio=NULL; - } else { - if(abs(a_pos-v_pos)>0x100000) force_ni=2; - } - } else { - // no index - if(force_ni){ - MSG_V(MSGTR_UsingNINI); - priv->idx_pos_a= - priv->idx_pos_v=demuxer->movi_start; - priv->nini=1; - } - demuxer->flags &= ~DEMUXF_SEEKABLE; - } + } + } else demuxer->flags &= ~DEMUXF_SEEKABLE; if(!ds_fill_buffer(d_video)){ MSG_ERR("AVI: " MSGTR_MissingVideoStreamBug); return NULL; @@ -1545,8 +1518,6 @@ } static const config_t avi_options[] = { - {"ni", &force_ni, CONF_TYPE_FLAG, 0, 0, 1, "force usage of non-interleaved AVI parser"}, - {"noni", &force_ni, CONF_TYPE_FLAG, 0, 1, 0, "disables usage of non-interleaved AVI parser"}, {"noidx", &index_mode, CONF_TYPE_FLAG, 0, -1, 0, "disables INDEXES for AVI's demuxing"}, {"idx", &index_mode, CONF_TYPE_FLAG, 0, -1, 1, "builds internal INDEXES of incomplete AVIs"}, {"forceidx", &index_mode, CONF_TYPE_FLAG, 0, -1, 2, "forces rebuilding of INDEXES for broken AVIs"}, Modified: mplayerxp/libmpdemux/demuxer.cpp =================================================================== --- mplayerxp/libmpdemux/demuxer.cpp 2012-11-23 10:26:17 UTC (rev 439) +++ mplayerxp/libmpdemux/demuxer.cpp 2012-11-23 10:53:52 UTC (rev 440) @@ -545,7 +545,6 @@ unsigned i; demuxer_t *demuxer=NULL,*new_demux=NULL; - pts_from_bps=0; demux_aid_vid_mismatch = 0; i=0; again: Modified: mplayerxp/libmpdemux/demuxer.h =================================================================== --- mplayerxp/libmpdemux/demuxer.h 2012-11-23 10:26:17 UTC (rev 439) +++ mplayerxp/libmpdemux/demuxer.h 2012-11-23 10:53:52 UTC (rev 440) @@ -250,8 +250,6 @@ /* AVI demuxer params: */ extern int index_mode; /**< -1=untouched 0=don't use index 1=use (geneate) index */ -extern int force_ni; -extern int pts_from_bps; extern int demux_aid_vid_mismatch; enum { INFOT_NULL =0, Modified: mplayerxp/libvo/video_out.cpp =================================================================== --- mplayerxp/libvo/video_out.cpp 2012-11-23 10:26:17 UTC (rev 439) +++ mplayerxp/libvo/video_out.cpp 2012-11-23 10:53:52 UTC (rev 440) @@ -172,7 +172,6 @@ vo_conf.movie_aspect=-1.0; vo_conf.flip=-1; vo_conf.xp_buffs=64; - vo_conf.WinID=-1; vo=new(zeromem) vo_data_t; vo->window = None; Modified: mplayerxp/libvo/video_out.h =================================================================== --- mplayerxp/libvo/video_out.h 2012-11-23 10:26:17 UTC (rev 439) +++ mplayerxp/libvo/video_out.h 2012-11-23 10:53:52 UTC (rev 440) @@ -131,7 +131,6 @@ char * subdevice; // currently unused char* mDisplayName; - int WinID; /* output window id */ int vsync; unsigned xp_buffs; /**< contains number of buffers for decoding ahead */ Modified: mplayerxp/libvo/vo_opengl.cpp =================================================================== --- mplayerxp/libvo/vo_opengl.cpp 2012-11-23 10:26:17 UTC (rev 439) +++ mplayerxp/libvo/vo_opengl.cpp 2012-11-23 10:53:52 UTC (rev 440) @@ -139,15 +139,7 @@ static void resize(vo_data_t*vo,int x,int y){ priv_t*priv=reinterpret_cast<priv_t*>(vo->priv); MSG_V("[gl] Resize: %dx%d\n",x,y); - if (vo_conf.WinID >= 0) { - unsigned top = 0, left = 0, w = x, h = y; - aspect(&w,&h,A_ZOOM); - left=( vo_conf.screenwidth - (priv->dwidth > vo_conf.screenwidth?vo_conf.screenwidth:priv->dwidth) ) / 2; - top=( vo_conf.screenheight - (priv->dheight > vo_conf.screenheight?vo_conf.screenheight:priv->dheight) ) / 2; - w=(priv->dwidth > vo_conf.screenwidth?vo_conf.screenwidth:priv->dwidth); - h=(priv->dheight > vo_conf.screenheight?vo_conf.screenheight:priv->dheight); - gl_init_fb(vo,left,top,w,h); - } else gl_init_fb(vo, 0, 0, x, y ); + gl_init_fb(vo, 0, 0, x, y ); glClear(GL_COLOR_BUFFER_BIT); } @@ -192,21 +184,16 @@ xswa.border_pixel = 0; xswamask = CWBackPixel | CWBorderPixel; - if ( vo_conf.WinID>=0 ) { - vo->window = vo_conf.WinID ? ((Window)vo_conf.WinID) : RootWindow(vo->mDisplay,vo->mScreen); - XUnmapWindow( vo->mDisplay,vo->window ); - XChangeWindowAttributes( vo->mDisplay,vo->window,xswamask,&xswa ); - } else - vo->window = XCreateWindow( vo->mDisplay, RootWindow(vo->mDisplay,vo->mScreen), - hint.x, hint.y, hint.width, hint.height, - 0, priv->depth,CopyFromParent,priv->vinfo.visual,xswamask,&xswa); + vo->window = XCreateWindow( vo->mDisplay, RootWindow(vo->mDisplay,vo->mScreen), + hint.x, hint.y, hint.width, hint.height, + 0, priv->depth,CopyFromParent,priv->vinfo.visual,xswamask,&xswa); vo_x11_classhint( vo->mDisplay,vo->window,"opengl" ); vo_x11_hidecursor(vo->mDisplay,vo->window); - XSelectInput(vo->mDisplay, vo->window, StructureNotifyMask | KeyPressMask | - ((vo_conf.WinID==0) ? 0 : (PointerMotionMask - | ButtonPressMask | ButtonReleaseMask ))); + XSelectInput(vo->mDisplay, vo->window, + StructureNotifyMask | KeyPressMask | PointerMotionMask | + ButtonPressMask | ButtonReleaseMask ); XSetStandardProperties(vo->mDisplay, vo->window, hello, hello, None, NULL, 0, &hint); if ( vo_FS(vo) ) vo_x11_decoration(vo, vo->mDisplay,vo->window,0 ); XMapWindow(vo->mDisplay, vo->window); Modified: mplayerxp/libvo/vo_x11.cpp =================================================================== --- mplayerxp/libvo/vo_x11.cpp 2012-11-23 10:26:17 UTC (rev 439) +++ mplayerxp/libvo/vo_x11.cpp 2012-11-23 10:53:52 UTC (rev 440) @@ -213,16 +213,10 @@ } #endif - if ( vo_conf.WinID>=0 ){ - vo->window = vo_conf.WinID ? ((Window)vo_conf.WinID) : RootWindow( vo->mDisplay,vo->mScreen ); - XUnmapWindow( vo->mDisplay,vo->window ); - XChangeWindowAttributes( vo->mDisplay,vo->window,xswamask,&xswa ); - } else { - vo->window=XCreateWindow( vo->mDisplay,RootWindow( vo->mDisplay,vo->mScreen ), + vo->window=XCreateWindow( vo->mDisplay,RootWindow( vo->mDisplay,vo->mScreen ), hint.x,hint.y, hint.width,hint.height, xswa.border_pixel,priv->depth,CopyFromParent,priv->vinfo.visual,xswamask,&xswa ); - } vo_x11_classhint( vo->mDisplay,vo->window,"vo_x11" ); vo_x11_hidecursor(vo->mDisplay,vo->window); if ( vo_FS(vo) ) vo_x11_decoration(vo,vo->mDisplay,vo->window,0 ); @@ -232,7 +226,6 @@ #ifdef HAVE_XINERAMA vo_x11_xinerama_move(vo,vo->mDisplay,vo->window,&hint); #endif - if(vo_conf.WinID!=0) do { XNextEvent( vo->mDisplay,&xev ); } while ( xev.type != MapNotify || xev.xmap.event != vo->window ); XSelectInput( vo->mDisplay,vo->window,NoEventMask ); @@ -241,8 +234,9 @@ vo->gc=XCreateGC( vo->mDisplay,vo->window,0L,&xgcv ); /* we cannot grab mouse events on root window :( */ - XSelectInput( vo->mDisplay,vo->window,StructureNotifyMask | KeyPressMask | - ((vo_conf.WinID==0)?0:(ButtonPressMask | ButtonReleaseMask | PointerMotionMask)) ); + XSelectInput(vo->mDisplay,vo->window, + StructureNotifyMask | KeyPressMask | + ButtonPressMask | ButtonReleaseMask | PointerMotionMask); #ifdef HAVE_XF86VM if ( vo_VM(vo) ) { Modified: mplayerxp/libvo/vo_xv.cpp =================================================================== --- mplayerxp/libvo/vo_xv.cpp 2012-11-23 10:26:17 UTC (rev 439) +++ mplayerxp/libvo/vo_xv.cpp 2012-11-23 10:53:52 UTC (rev 440) @@ -306,21 +306,16 @@ xswa.border_pixel = 0; xswamask = CWBackPixel | CWBorderPixel; - if ( vo_conf.WinID>=0 ){ - vo->window = vo_conf.WinID ? ((Window)vo_conf.WinID) : RootWindow(vo->mDisplay,vo->mScreen); - XUnmapWindow( vo->mDisplay,vo->window ); - XChangeWindowAttributes( vo->mDisplay,vo->window,xswamask,&xswa ); - } else - vo->window = XCreateWindow( vo->mDisplay, RootWindow(vo->mDisplay,vo->mScreen), - hint.x, hint.y, hint.width, hint.height, - 0, priv->depth,CopyFromParent,vinfo.visual,xswamask,&xswa); + vo->window = XCreateWindow( vo->mDisplay, RootWindow(vo->mDisplay,vo->mScreen), + hint.x, hint.y, hint.width, hint.height, + 0, priv->depth,CopyFromParent,vinfo.visual,xswamask,&xswa); vo_x11_classhint( vo->mDisplay,vo->window,"xv" ); vo_x11_hidecursor(vo->mDisplay,vo->window); - XSelectInput(vo->mDisplay, vo->window, StructureNotifyMask | KeyPressMask | - ((vo_conf.WinID==0) ? 0 : (PointerMotionMask - | ButtonPressMask | ButtonReleaseMask))); + XSelectInput(vo->mDisplay, vo->window, + StructureNotifyMask | KeyPressMask | + PointerMotionMask | ButtonPressMask | ButtonReleaseMask); XSetStandardProperties(vo->mDisplay, vo->window, hello, hello, None, NULL, 0, &hint); if ( vo_FS(vo) ) vo_x11_decoration(vo,vo->mDisplay,vo->window,0 ); XMapWindow(vo->mDisplay, vo->window); Modified: mplayerxp/libvo/x11_common.cpp =================================================================== --- mplayerxp/libvo/x11_common.cpp 2012-11-23 10:26:17 UTC (rev 439) +++ mplayerxp/libvo/x11_common.cpp 2012-11-23 10:53:52 UTC (rev 440) @@ -184,8 +184,6 @@ Colormap colormap; static char bm_no_data[] = { 0,0,0,0, 0,0,0,0 }; - if(vo_conf.WinID==0) return; // do not hide, if we're playing at rootwin - colormap = DefaultColormap(disp,DefaultScreen(disp)); XAllocNamedColor(disp,colormap,"black",&black,&dummy); bm_no = XCreateBitmapFromData(disp, win, bm_no_data, 8,8); @@ -614,8 +612,7 @@ { XSetErrorHandler(NULL); /* and -wid is set */ - if (!(vo_conf.WinID > 0)) - XDestroyWindow(display, window); + XDestroyWindow(display, window); XCloseDisplay(display); vo->depthonscreen = 0; delete vo->priv2; Modified: mplayerxp/mplayerxp.cpp =================================================================== --- mplayerxp/mplayerxp.cpp 2012-11-23 10:26:17 UTC (rev 439) +++ mplayerxp/mplayerxp.cpp 2012-11-23 10:53:52 UTC (rev 440) @@ -2003,8 +2003,6 @@ if(!sh_audio && !sh_video) exit_player("Nothing to do"); - if(MPXPSys->demuxer()->file_format!=DEMUXER_TYPE_AVI) pts_from_bps=0; // it must be 0 for mpeg/asf! - if(mp_conf.force_fps && sh_video) { sh_video->fps=mp_conf.force_fps; MSG_INFO(MSGTR_FPSforced,sh_video->fps,1.0f/sh_video->fps); Modified: mplayerxp/xmpcore/xmp_vplayer.cpp =================================================================== --- mplayerxp/xmpcore/xmp_vplayer.cpp 2012-11-23 10:26:17 UTC (rev 439) +++ mplayerxp/xmpcore/xmp_vplayer.cpp 2012-11-23 10:53:52 UTC (rev 440) @@ -244,19 +244,10 @@ if(xmp_test_model(XMP_Run_AudioPlayer)) delay += get_delay_audio_buffer(); - if(pts_from_bps){ - 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 - a_pts=samples*(float)sh_audio->audio.dwScale/(float)sh_audio->audio.dwRate; - delay_corrected=1; - } else { - // PTS = (last timestamp) + (bytes after last timestamp)/(bytes per sec) - a_pts=d_audio->pts; - if(!delay_corrected) if(a_pts) delay_corrected=1; - a_pts+=(ds_tell_pts_r(d_audio)-sh_audio->a_in_buffer_len)/(float)sh_audio->i_bps; - } + // PTS = (last timestamp) + (bytes after last timestamp)/(bytes per sec) + a_pts=d_audio->pts; + if(!delay_corrected) if(a_pts) delay_corrected=1; + a_pts+=(ds_tell_pts_r(d_audio)-sh_audio->a_in_buffer_len)/(float)sh_audio->i_bps; MSG_DBG2("### A:%8.3f (%8.3f) V:%8.3f A-V:%7.4f \n",a_pts,a_pts-delay,v_pts,(a_pts-delay)-v_pts); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |