[Mplayerxp-cvslog] SF.net SVN: mplayerxp:[374] mplayerxp
Brought to you by:
olov
From: <nic...@us...> - 2012-11-15 14:34:55
|
Revision: 374 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=374&view=rev Author: nickols_k Date: 2012-11-15 14:34:45 +0000 (Thu, 15 Nov 2012) Log Message: ----------- rename mp_data ->MPXPCtx Modified Paths: -------------- mplayerxp/libmpcodecs/ad_a52.c mplayerxp/libmpcodecs/ad_dca.c mplayerxp/libmpcodecs/ad_faad.c mplayerxp/libmpcodecs/dec_video.c mplayerxp/libmpcodecs/vd_dshow.c mplayerxp/libmpcodecs/vd_libmpeg2.c mplayerxp/libmpcodecs/vd_vfw.c mplayerxp/libmpdemux/cache2.c mplayerxp/libmpdemux/demuxer.cpp mplayerxp/libmpdemux/demuxer_r.cpp mplayerxp/libplaytree/asxparser.c mplayerxp/mp_msg.cpp mplayerxp/mplayerxp.cpp mplayerxp/mplayerxp.h mplayerxp/xmpcore/xmp_adecoder.cpp mplayerxp/xmpcore/xmp_aplayer.cpp mplayerxp/xmpcore/xmp_vdecoder.cpp mplayerxp/xmpcore/xmp_vplayer.cpp Modified: mplayerxp/libmpcodecs/ad_a52.c =================================================================== --- mplayerxp/libmpcodecs/ad_a52.c 2012-11-15 14:18:24 UTC (rev 373) +++ mplayerxp/libmpcodecs/ad_a52.c 2012-11-15 14:34:45 UTC (rev 374) @@ -155,7 +155,7 @@ float pts; int flags=0; /* Dolby AC3 audio:*/ - mpxp_a52_accel = mp_data->mplayer_accel; + mpxp_a52_accel = MPXPCtx->mplayer_accel; mpxp_a52_state=a52_init (mpxp_a52_accel); if (mpxp_a52_state == NULL) { MSG_ERR("A52 init failed\n"); Modified: mplayerxp/libmpcodecs/ad_dca.c =================================================================== --- mplayerxp/libmpcodecs/ad_dca.c 2012-11-15 14:18:24 UTC (rev 373) +++ mplayerxp/libmpcodecs/ad_dca.c 2012-11-15 14:34:45 UTC (rev 374) @@ -155,7 +155,7 @@ float pts; int flags=0; /* Dolby AC3 audio:*/ - mpxp_dca_accel = mp_data->mplayer_accel; + mpxp_dca_accel = MPXPCtx->mplayer_accel; mpxp_dca_state = dca_init(mpxp_dca_accel); if (mpxp_dca_state == NULL) { MSG_ERR("dca init failed\n"); Modified: mplayerxp/libmpcodecs/ad_faad.c =================================================================== --- mplayerxp/libmpcodecs/ad_faad.c 2012-11-15 14:18:24 UTC (rev 373) +++ mplayerxp/libmpcodecs/ad_faad.c 2012-11-15 14:34:45 UTC (rev 374) @@ -193,7 +193,7 @@ float pts; int NeAAC_init; NeAACDecConfigurationPtr NeAAC_conf; - if(!(NeAAC_hdec = NeAACDecOpen(mp_data->mplayer_accel))) { + if(!(NeAAC_hdec = NeAACDecOpen(MPXPCtx->mplayer_accel))) { MSG_WARN("FAAD: Failed to open the decoder!\n"); // XXX: deal with cleanup! return MPXP_False; } Modified: mplayerxp/libmpcodecs/dec_video.c =================================================================== --- mplayerxp/libmpcodecs/dec_video.c 2012-11-15 14:18:24 UTC (rev 373) +++ mplayerxp/libmpcodecs/dec_video.c 2012-11-15 14:34:45 UTC (rev 374) @@ -305,11 +305,11 @@ t2=GetTimer();t=t2-t; tt = t*0.000001f; - mp_data->bench->video+=tt; + MPXPCtx->bench->video+=tt; if(mp_conf.benchmark || mp_conf.frame_dropping) { - if(tt > mp_data->bench->max_video) mp_data->bench->max_video=tt; - if(tt < mp_data->bench->min_video) mp_data->bench->min_video=tt; - mp_data->bench->cur_video=tt; + if(tt > MPXPCtx->bench->max_video) MPXPCtx->bench->max_video=tt; + if(tt < MPXPCtx->bench->min_video) MPXPCtx->bench->min_video=tt; + MPXPCtx->bench->cur_video=tt; } if(frame->flags) return 0; @@ -318,12 +318,12 @@ t2=GetTimer()-t2; tt=t2*0.000001f; - mp_data->bench->vout+=tt; + MPXPCtx->bench->vout+=tt; if(mp_conf.benchmark || mp_conf.frame_dropping) { - if(tt > mp_data->bench->max_vout) mp_data->bench->max_vout = tt; - if(tt < mp_data->bench->min_vout) mp_data->bench->min_vout = tt; - mp_data->bench->cur_vout=tt; + if(tt > MPXPCtx->bench->max_vout) MPXPCtx->bench->max_vout = tt; + if(tt < MPXPCtx->bench->min_vout) MPXPCtx->bench->min_vout = tt; + MPXPCtx->bench->cur_vout=tt; } return 1; @@ -345,12 +345,12 @@ demux_stream_t *d_dvdsub=sh_video->ds->demuxer->sub; #ifdef USE_SUB // find sub - if(mp_data->subtitles && v_pts>0){ + if(MPXPCtx->subtitles && v_pts>0){ float pts=v_pts; if(mp_conf.sub_fps==0) mp_conf.sub_fps=sh_video->fps; MP_UNIT("find_sub"); if (pts > sub_last_pts || pts < sub_last_pts-1.0 ) { - find_sub(mp_data->subtitles,sub_uses_time?(100*pts):(pts*mp_conf.sub_fps),vo_data); // FIXME! frame counter... + find_sub(MPXPCtx->subtitles,sub_uses_time?(100*pts):(pts*mp_conf.sub_fps),vo_data); // FIXME! frame counter... sub_last_pts = pts; } MP_UNIT(NULL); Modified: mplayerxp/libmpcodecs/vd_dshow.c =================================================================== --- mplayerxp/libmpcodecs/vd_dshow.c 2012-11-15 14:18:24 UTC (rev 373) +++ mplayerxp/libmpcodecs/vd_dshow.c 2012-11-15 14:34:45 UTC (rev 374) @@ -87,7 +87,7 @@ default: DS_VideoDecoder_SetDestFmt(sh->context,out_fmt&255,0); // RGB/BGR } - DS_SetAttr_DivX("Quality",mp_data->output_quality); + DS_SetAttr_DivX("Quality",MPXPCtx->output_quality); DS_VideoDecoder_StartInternal(sh->context); MSG_V("INFO: Win32/DShow init OK!\n"); return MPXP_Ok; Modified: mplayerxp/libmpcodecs/vd_libmpeg2.c =================================================================== --- mplayerxp/libmpcodecs/vd_libmpeg2.c 2012-11-15 14:18:24 UTC (rev 373) +++ mplayerxp/libmpcodecs/vd_libmpeg2.c 2012-11-15 14:34:45 UTC (rev 374) @@ -261,7 +261,7 @@ priv_t *priv; if(!load_lib("libmpeg2"SLIBSUFFIX)) return MPXP_False; priv=sh->context=mp_malloc(sizeof(priv_t)); - if(!(priv->mpeg2dec=mpeg2_init(mp_data->mplayer_accel))) return MPXP_False; + if(!(priv->mpeg2dec=mpeg2_init(MPXPCtx->mplayer_accel))) return MPXP_False; return mpcodecs_config_vo(sh,sh->src_w,sh->src_h,libinput); } Modified: mplayerxp/libmpcodecs/vd_vfw.c =================================================================== --- mplayerxp/libmpcodecs/vd_vfw.c 2012-11-15 14:18:24 UTC (rev 373) +++ mplayerxp/libmpcodecs/vd_vfw.c 2012-11-15 14:34:45 UTC (rev 374) @@ -172,7 +172,7 @@ // avi_header.our_in_buffer=mp_malloc(avi_header.video.dwSuggestedBufferSize); // FIXME!!!! - ICSendMessage(priv->hic, ICM_USER+80, (long)(&mp_data->output_quality), 0); + ICSendMessage(priv->hic, ICM_USER+80, (long)(&MPXPCtx->output_quality), 0); // don't do this palette mess always, it makes div3 dll crashing... if(sh_video->codec->outfmt[sh_video->outfmtidx]==IMGFMT_BGR8){ Modified: mplayerxp/libmpdemux/cache2.c =================================================================== --- mplayerxp/libmpdemux/cache2.c 2012-11-15 14:18:24 UTC (rev 373) +++ mplayerxp/libmpdemux/cache2.c 2012-11-15 14:34:45 UTC (rev 374) @@ -258,9 +258,9 @@ if(mp_conf.benchmark) { t2=GetTimer();t=t2-t; tt = t*0.000001f; - mp_data->bench->c2+=tt; - if(tt > mp_data->bench->max_c2) mp_data->bench->max_c2=tt; - if(tt < mp_data->bench->min_c2) mp_data->bench->min_c2=tt; + MPXPCtx->bench->c2+=tt; + if(tt > MPXPCtx->bench->max_c2) MPXPCtx->bench->max_c2=tt; + if(tt < MPXPCtx->bench->min_c2) MPXPCtx->bench->min_c2=tt; } if(!cfill) usleep(FILL_USLEEP_TIME); // idle if(priv->state==Pth_Canceling) break; Modified: mplayerxp/libmpdemux/demuxer.cpp =================================================================== --- mplayerxp/libmpdemux/demuxer.cpp 2012-11-15 14:18:24 UTC (rev 373) +++ mplayerxp/libmpdemux/demuxer.cpp 2012-11-15 14:34:45 UTC (rev 374) @@ -624,7 +624,7 @@ if(!ad) MSG_WARN("Failed to open audio demuxer: %s\n",audio_stream); else if(ad->audio->sh && ((sh_audio_t*)ad->audio->sh)->wtag == 0x55) // MP3 - m_config_set_flag(mp_data->mconfig,"mp3.hr-seek",1); // Enable high res seeking + m_config_set_flag(MPXPCtx->mconfig,"mp3.hr-seek",1); // Enable high res seeking } if(ss) { sd = demux_open_stream(ss,sub_demuxer_type ? sub_demuxer_type : sfmt,-2,-2,dvdsub_id); Modified: mplayerxp/libmpdemux/demuxer_r.cpp =================================================================== --- mplayerxp/libmpdemux/demuxer_r.cpp 2012-11-15 14:18:24 UTC (rev 373) +++ mplayerxp/libmpdemux/demuxer_r.cpp 2012-11-15 14:34:45 UTC (rev 374) @@ -86,10 +86,10 @@ { t2=GetTimer();t=t2-t; tt = t*0.000001f; - mp_data->bench->demux+=tt; - mp_data->bench->audio_decode_correction=tt; - if(tt > mp_data->bench->max_demux) mp_data->bench->max_demux=tt; - if(tt < mp_data->bench->min_demux) mp_data->bench->min_demux=tt; + MPXPCtx->bench->demux+=tt; + MPXPCtx->bench->audio_decode_correction=tt; + if(tt > MPXPCtx->bench->max_demux) MPXPCtx->bench->max_demux=tt; + if(tt < MPXPCtx->bench->min_demux) MPXPCtx->bench->min_demux=tt; } UNLOCK_DEMUXER(); return retval; @@ -114,9 +114,9 @@ { t2=GetTimer();t=t2-t; tt = t*0.000001f; - mp_data->bench->demux+=tt; - if(tt > mp_data->bench->max_demux) mp_data->bench->max_demux=tt; - if(tt < mp_data->bench->min_demux) mp_data->bench->min_demux=tt; + MPXPCtx->bench->demux+=tt; + if(tt > MPXPCtx->bench->max_demux) MPXPCtx->bench->max_demux=tt; + if(tt < MPXPCtx->bench->min_demux) MPXPCtx->bench->min_demux=tt; } UNLOCK_DEMUXER(); return frame; @@ -137,10 +137,10 @@ { t2=GetTimer();t=t2-t; tt = t*0.000001f; - mp_data->bench->demux+=tt; - mp_data->bench->audio_decode_correction=tt; - if(tt > mp_data->bench->max_demux) mp_data->bench->max_demux=tt; - if(tt < mp_data->bench->min_demux) mp_data->bench->min_demux=tt; + MPXPCtx->bench->demux+=tt; + MPXPCtx->bench->audio_decode_correction=tt; + if(tt > MPXPCtx->bench->max_demux) MPXPCtx->bench->max_demux=tt; + if(tt < MPXPCtx->bench->min_demux) MPXPCtx->bench->min_demux=tt; } UNLOCK_DEMUXER(); return retval; @@ -161,10 +161,10 @@ { t2=GetTimer();t=t2-t; tt = t*0.000001f; - mp_data->bench->demux+=tt; - mp_data->bench->audio_decode_correction=tt; - if(tt > mp_data->bench->max_demux) mp_data->bench->max_demux=tt; - if(tt < mp_data->bench->min_demux) mp_data->bench->min_demux=tt; + MPXPCtx->bench->demux+=tt; + MPXPCtx->bench->audio_decode_correction=tt; + if(tt > MPXPCtx->bench->max_demux) MPXPCtx->bench->max_demux=tt; + if(tt < MPXPCtx->bench->min_demux) MPXPCtx->bench->min_demux=tt; } UNLOCK_DEMUXER(); return retval; @@ -192,9 +192,9 @@ { t2=GetTimer();t=t2-t; tt = t*0.000001f; - mp_data->bench->demux+=tt; - if(tt > mp_data->bench->max_demux) mp_data->bench->max_demux=tt; - if(tt < mp_data->bench->min_demux) mp_data->bench->min_demux=tt; + MPXPCtx->bench->demux+=tt; + if(tt > MPXPCtx->bench->max_demux) MPXPCtx->bench->max_demux=tt; + if(tt < MPXPCtx->bench->min_demux) MPXPCtx->bench->min_demux=tt; } UNLOCK_DEMUXER(); return retval; Modified: mplayerxp/libplaytree/asxparser.c =================================================================== --- mplayerxp/libplaytree/asxparser.c 2012-11-15 14:18:24 UTC (rev 373) +++ mplayerxp/libplaytree/asxparser.c 2012-11-15 14:34:45 UTC (rev 374) @@ -445,7 +445,7 @@ return; } val = asx_get_attrib("VALUE",attribs); - if(m_config_get_option(mp_data->mconfig,name) == NULL) { + if(m_config_get_option(MPXPCtx->mconfig,name) == NULL) { MSG_WARN("Found unknow param in asx: %s",name); if(val) MSG_WARN("=%s\n",val); Modified: mplayerxp/mp_msg.cpp =================================================================== --- mplayerxp/mp_msg.cpp 2012-11-15 14:18:24 UTC (rev 373) +++ mplayerxp/mp_msg.cpp 2012-11-15 14:34:45 UTC (rev 374) @@ -23,7 +23,7 @@ static char *_2ansi(unsigned char attr) { - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->msg_priv); + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->msg_priv); int bg = _bg(attr); int bc = priv->_color[bg & 7]; @@ -42,7 +42,7 @@ unsigned i; int _color[8]={0,4,2,6,1,5,3,7}; priv_t*priv=new priv_t; - mp_data->msg_priv=priv; + MPXPCtx->msg_priv=priv; memcpy(priv->_color,_color,sizeof(_color)); pthread_mutex_init(&priv->mp_msg_mutex,NULL); for(i=0;i<sizeof(hl)/sizeof(char);i++) memcpy(priv->scol[i],_2ansi(hl[i]),sizeof(priv->scol[0])); @@ -50,7 +50,7 @@ void mpxp_print_uninit(void) { - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->msg_priv); + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->msg_priv); if(isatty(fileno(stderr))) fprintf(stderr,priv->scol[8]); mpxp_print_flush(); pthread_mutex_destroy(&priv->mp_msg_mutex); @@ -90,7 +90,7 @@ unsigned mod=x&0x0FFFFFFF; static int was_eol=1; priv_t*priv=NULL; - if(mp_data) priv=reinterpret_cast<priv_t*>(mp_data->msg_priv); + if(MPXPCtx) priv=reinterpret_cast<priv_t*>(MPXPCtx->msg_priv); if(level>mp_conf.verbose+MSGL_V-1) return 0; /* do not display */ if((mod&mp_conf.msg_filter)==0) return 0; /* do not display */ if(priv) { Modified: mplayerxp/mplayerxp.cpp =================================================================== --- mplayerxp/mplayerxp.cpp 2012-11-15 14:18:24 UTC (rev 373) +++ mplayerxp/mplayerxp.cpp 2012-11-15 14:34:45 UTC (rev 374) @@ -157,7 +157,7 @@ mp_conf_t mp_conf; static volatile char antiviral_hole2[__VM_PAGE_SIZE__] __PAGE_ALIGNED__; -mp_data_t* mp_data=NULL; +MPXPContext_t* MPXPCtx=NULL; xp_core_t* xp_core=NULL; static volatile char antiviral_hole3[__VM_PAGE_SIZE__] __PAGE_ALIGNED__; volatile MPXPSecureKeys* secure_keys; @@ -206,13 +206,13 @@ } static void mpxp_init_structs(void) { - mp_data=new(zeromem) mp_data_t; - mp_data->seek_time=-1; - mp_data->bench=new(zeromem) time_usage_t; - mp_data->use_pts_fix2=-1; - mp_data->rtc_fd=-1; - mp_data->priv=new(zeromem)priv_t; - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->priv); + MPXPCtx=new(zeromem) MPXPContext_t; + MPXPCtx->seek_time=-1; + MPXPCtx->bench=new(zeromem) time_usage_t; + MPXPCtx->use_pts_fix2=-1; + MPXPCtx->rtc_fd=-1; + MPXPCtx->priv=new(zeromem)priv_t; + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->priv); priv->osd_function=OSD_PLAY; #if defined( ARCH_X86 ) || defined(ARCH_X86_64) memset(&x86,-1,sizeof(x86_features_t)); @@ -247,18 +247,18 @@ #ifdef ENABLE_WIN32LOADER free_codec_cfg(); #endif - delete mp_data->bench; - delete reinterpret_cast<priv_t*>(mp_data->priv); - delete mp_data; + delete MPXPCtx->bench; + delete reinterpret_cast<priv_t*>(MPXPCtx->priv); + delete MPXPCtx; if(vo_data) mp_free(vo_data); if(ao_data) mp_free(ao_data); - mp_data=NULL; + MPXPCtx=NULL; xmp_uninit(); mp_uninit_malloc(mp_conf.verbose); } void uninit_player(unsigned int mask){ - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->priv); + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->priv); stream_t* stream=NULL; sh_audio_t* sh_audio=NULL; sh_video_t* sh_video=NULL; @@ -344,10 +344,10 @@ priv->inited_flags&=~INITED_SUBTITLE; MP_UNIT("sub_free"); mp_input_close(priv->libinput); - sub_free( mp_data->subtitles ); + sub_free( MPXPCtx->subtitles ); mp_conf.sub_name=NULL; vo_data->sub=NULL; - mp_data->subtitles=NULL; + MPXPCtx->subtitles=NULL; } #endif MP_UNIT(NULL); @@ -362,7 +362,7 @@ MP_UNIT("exit_player"); if(why) MSG_HINT(MSGTR_Exiting,why); - if(mp_data->mconfig) m_config_free(mp_data->mconfig); + if(MPXPCtx->mconfig) m_config_free(MPXPCtx->mconfig); mpxp_print_uninit(); mpxp_uninit_structs(); if(why) exit(0); @@ -426,7 +426,7 @@ // The function return a new value for eof. static int libmpdemux_was_interrupted(int eof) { - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->priv); + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->priv); mp_cmd_t* cmd; if((cmd = mp_input_get_cmd(priv->libinput,0,0,0)) != NULL) { switch(cmd->id) { @@ -496,12 +496,12 @@ gCpuCaps.hasAES, gCpuCaps.hasAVX, gCpuCaps.hasFMA); - if(gCpuCaps.hasMMX) mp_data->mplayer_accel |= MM_ACCEL_X86_MMX; - if(gCpuCaps.hasMMX2) mp_data->mplayer_accel |= MM_ACCEL_X86_MMXEXT; - if(gCpuCaps.hasSSE) mp_data->mplayer_accel |= MM_ACCEL_X86_SSE; - if(gCpuCaps.has3DNow) mp_data->mplayer_accel |= MM_ACCEL_X86_3DNOW; - if(gCpuCaps.has3DNowExt) mp_data->mplayer_accel |= MM_ACCEL_X86_3DNOWEXT; - MSG_V("mp_data->mplayer_accel=%i\n",mp_data->mplayer_accel); + if(gCpuCaps.hasMMX) MPXPCtx->mplayer_accel |= MM_ACCEL_X86_MMX; + if(gCpuCaps.hasMMX2) MPXPCtx->mplayer_accel |= MM_ACCEL_X86_MMXEXT; + if(gCpuCaps.hasSSE) MPXPCtx->mplayer_accel |= MM_ACCEL_X86_SSE; + if(gCpuCaps.has3DNow) MPXPCtx->mplayer_accel |= MM_ACCEL_X86_3DNOW; + if(gCpuCaps.has3DNowExt) MPXPCtx->mplayer_accel |= MM_ACCEL_X86_3DNOWEXT; + MSG_V("MPXPCtx->mplayer_accel=%i\n",MPXPCtx->mplayer_accel); } #endif @@ -574,8 +574,8 @@ } extern "C" void show_long_help(void) { - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->priv); - m_config_show_options(mp_data->mconfig); + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->priv); + m_config_show_options(MPXPCtx->mconfig); mp_input_print_binds(priv->libinput); print_stream_drivers(); vo_print_help(vo_data); @@ -603,7 +603,7 @@ //================= Update OSD ==================== void update_osd( float v_pts ) { - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->priv); + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->priv); static char osd_text_buffer[64]; static int osd_last_pts=-303; //================= Update OSD ==================== @@ -647,7 +647,7 @@ void mpxp_seek( osd_args_t *osd,const seek_args_t* seek) { - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->priv); + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->priv); sh_audio_t* sh_audio=reinterpret_cast<sh_audio_t*>(priv->demuxer->audio->sh); sh_video_t* sh_video=reinterpret_cast<sh_video_t*>(priv->demuxer->video->sh); demux_stream_t *d_dvdsub=priv->demuxer->sub; @@ -655,10 +655,10 @@ xp_core->audio->eof=0; if(seek->secs || seek->flags&DEMUX_SEEK_SET) { seek_rval=demux_seek_r(priv->demuxer,seek); - mp_data->mpxp_after_seek=25; /* 1 sec delay */ + MPXPCtx->mpxp_after_seek=25; /* 1 sec delay */ } if(seek_rval){ - mp_data->seek_time = GetTimerMS(); + MPXPCtx->seek_time = GetTimerMS(); // success: /* FIXME there should be real seeking for vobsub */ @@ -704,7 +704,7 @@ if(sh_video) { max_pts_correction=0.1; if(osd) osd->visible=sh_video->fps<=60?sh_video->fps:25; // to rewert to PLAY pointer after 1 sec - mp_data->bench->audio=0; mp_data->bench->audio_decode=0; mp_data->bench->video=0; mp_data->bench->vout=0; + MPXPCtx->bench->audio=0; MPXPCtx->bench->audio_decode=0; MPXPCtx->bench->video=0; MPXPCtx->bench->vout=0; if(vo_data->spudec) { unsigned char* packet=NULL; while(ds_get_packet_sub_r(d_dvdsub,&packet)>0) ; // Empty stream @@ -718,7 +718,7 @@ void mpxp_reset_vcache(void) { - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->priv); + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->priv); sh_video_t* sh_video=reinterpret_cast<sh_video_t*>(priv->demuxer->video->sh); seek_args_t seek = { 0, DEMUX_SEEK_CUR|DEMUX_SEEK_SECONDS }; if(sh_video) mpxp_seek(NULL,&seek); @@ -727,7 +727,7 @@ void mpxp_resync_audio_stream(void) { - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->priv); + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->priv); sh_audio_t* sh_audio=reinterpret_cast<sh_audio_t*>(priv->demuxer->audio->sh); mpca_resync_stream(sh_audio->decoder); } @@ -739,39 +739,39 @@ static void init_benchmark(void) { - mp_data->bench->max_audio=0; mp_data->bench->max_video=0; mp_data->bench->max_vout=0; - mp_data->bench->min_audio=HUGE; mp_data->bench->min_video=HUGE; mp_data->bench->min_vout=HUGE; + MPXPCtx->bench->max_audio=0; MPXPCtx->bench->max_video=0; MPXPCtx->bench->max_vout=0; + MPXPCtx->bench->min_audio=HUGE; MPXPCtx->bench->min_video=HUGE; MPXPCtx->bench->min_vout=HUGE; - mp_data->bench->min_audio_decode=HUGE; - mp_data->bench->max_audio_decode=0; + MPXPCtx->bench->min_audio_decode=HUGE; + MPXPCtx->bench->max_audio_decode=0; - mp_data->bench->max_demux=0; - mp_data->bench->demux=0; - mp_data->bench->min_demux=HUGE; + MPXPCtx->bench->max_demux=0; + MPXPCtx->bench->demux=0; + MPXPCtx->bench->min_demux=HUGE; - mp_data->bench->cur_video=0; - mp_data->bench->cur_vout=0; - mp_data->bench->cur_audio=0; + MPXPCtx->bench->cur_video=0; + MPXPCtx->bench->cur_vout=0; + MPXPCtx->bench->cur_audio=0; } static void show_benchmark(void) { - double tot=(mp_data->bench->video+mp_data->bench->vout+mp_data->bench->audio+mp_data->bench->audio_decode+mp_data->bench->demux+mp_data->bench->c2); + double tot=(MPXPCtx->bench->video+MPXPCtx->bench->vout+MPXPCtx->bench->audio+MPXPCtx->bench->audio_decode+MPXPCtx->bench->demux+MPXPCtx->bench->c2); double total_time_usage; - mp_data->bench->total_start=GetTimer()-mp_data->bench->total_start; - total_time_usage = (float)mp_data->bench->total_start*0.000001; + MPXPCtx->bench->total_start=GetTimer()-MPXPCtx->bench->total_start; + total_time_usage = (float)MPXPCtx->bench->total_start*0.000001; MSG_INFO("\nAVE BENCHMARKs: VC:%8.3fs VO:%8.3fs A:%8.3fs D:%8.3fs = %8.4fs C:%8.3fs\n", - mp_data->bench->video,mp_data->bench->vout,mp_data->bench->audio+mp_data->bench->audio_decode, - mp_data->bench->demux,mp_data->bench->c2,tot); + MPXPCtx->bench->video,MPXPCtx->bench->vout,MPXPCtx->bench->audio+MPXPCtx->bench->audio_decode, + MPXPCtx->bench->demux,MPXPCtx->bench->c2,tot); if(total_time_usage>0.0) MSG_INFO("AVE BENCHMARK%%: VC:%8.4f%% VO:%8.4f%% A:%8.4f%% D:%8.4f%% C:%8.4f%% = %8.4f%%\n", - 100.0*mp_data->bench->video/total_time_usage, - 100.0*mp_data->bench->vout/total_time_usage, - 100.0*(mp_data->bench->audio+mp_data->bench->audio_decode)/total_time_usage, - 100.0*mp_data->bench->demux/total_time_usage, - 100.0*mp_data->bench->c2/total_time_usage, + 100.0*MPXPCtx->bench->video/total_time_usage, + 100.0*MPXPCtx->bench->vout/total_time_usage, + 100.0*(MPXPCtx->bench->audio+MPXPCtx->bench->audio_decode)/total_time_usage, + 100.0*MPXPCtx->bench->demux/total_time_usage, + 100.0*MPXPCtx->bench->c2/total_time_usage, 100.0*tot/total_time_usage); unsigned nframes=xp_core->video->num_played_frames; MSG_INFO("\nREAL RESULTS: from %u was dropped=%u\n" @@ -780,17 +780,17 @@ static void show_benchmark_status(void) { - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->priv); + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->priv); sh_audio_t* sh_audio=reinterpret_cast<sh_audio_t*>(priv->demuxer->audio->sh); if(xmp_test_model(XMP_Run_AudioPlayback)) MSG_STATUS("A:%6.1f %4.1f%%\r" ,sh_audio->timer-ao_get_delay(ao_data) - ,(sh_audio->timer>0.5)?100.0*(mp_data->bench->audio+mp_data->bench->audio_decode)/(double)sh_audio->timer:0 + ,(sh_audio->timer>0.5)?100.0*(MPXPCtx->bench->audio+MPXPCtx->bench->audio_decode)/(double)sh_audio->timer:0 ); else MSG_STATUS("A:%6.1f %4.1f%% B:%4.1f\r" ,sh_audio->timer-ao_get_delay(ao_data) - ,(sh_audio->timer>0.5)?100.0*(mp_data->bench->audio+mp_data->bench->audio_decode)/(double)sh_audio->timer:0 + ,(sh_audio->timer>0.5)?100.0*(MPXPCtx->bench->audio+MPXPCtx->bench->audio_decode)/(double)sh_audio->timer:0 ,get_delay_audio_buffer() ); } @@ -800,7 +800,7 @@ static void mpxp_init_keyboard_fifo(void) { - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->priv); + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->priv); #ifdef HAVE_TERMCAP load_termcap(NULL); // load key-codes #endif @@ -811,7 +811,7 @@ } void mplayer_put_key(int code){ - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->priv); + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->priv); mp_cmd_t* cmd; cmd=mp_input_get_cmd_from_keys(priv->libinput,1,&code); mp_input_queue_cmd(priv->libinput,cmd); @@ -850,7 +850,7 @@ } static char * mpxp_init_output_subsystems(void) { - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->priv); + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->priv); char* rs=NULL; unsigned i; // check video_out driver name: @@ -895,7 +895,7 @@ } static int mpxp_init_vobsub(const char *filename) { - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->priv); + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->priv); int forced_subs_only=0; MP_UNIT("vobsub"); if (mp_conf.vobsub_name){ @@ -924,7 +924,7 @@ } static int mpxp_handle_playlist(const char *filename) { - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->priv); + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->priv); stream_t* stream=priv->demuxer->stream; int eof=0; play_tree_t* entry; @@ -961,7 +961,7 @@ static void mpxp_init_dvd_nls(void) { /* Add NLS support here */ - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->priv); + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->priv); stream_t* stream=priv->demuxer->stream; char *lang; if(!mp_conf.audio_lang) mp_conf.audio_lang=nls_get_screen_cp(); @@ -985,7 +985,7 @@ } static void mpxp_print_stream_formats(void) { - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->priv); + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->priv); sh_audio_t* sh_audio=reinterpret_cast<sh_audio_t*>(priv->demuxer->audio->sh); sh_video_t* sh_video=reinterpret_cast<sh_video_t*>(priv->demuxer->video->sh); int fmt; @@ -1014,7 +1014,7 @@ } static void mpxp_read_video_properties(void) { - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->priv); + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->priv); sh_video_t* sh_video=reinterpret_cast<sh_video_t*>(priv->demuxer->video->sh); demux_stream_t *d_video=priv->demuxer->video; MP_UNIT("video_read_properties"); @@ -1041,7 +1041,7 @@ } static void mpxp_read_subtitles(const char *filename,int forced_subs_only,int stream_dump_type) { - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->priv); + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->priv); sh_video_t* sh_video=reinterpret_cast<sh_video_t*>(priv->demuxer->video->sh); stream_t* stream=priv->demuxer->stream; if (mp_conf.spudec_ifo) { @@ -1076,15 +1076,15 @@ // check .sub MP_UNIT("read_subtitles_file"); if(mp_conf.sub_name){ - mp_data->subtitles=sub_read_file(mp_conf.sub_name, sh_video->fps); - if(!mp_data->subtitles) MSG_ERR(MSGTR_CantLoadSub,mp_conf.sub_name); + MPXPCtx->subtitles=sub_read_file(mp_conf.sub_name, sh_video->fps); + if(!MPXPCtx->subtitles) MSG_ERR(MSGTR_CantLoadSub,mp_conf.sub_name); } else if(mp_conf.sub_auto) { // auto load sub file ... - mp_data->subtitles=sub_read_file( filename ? sub_filename( get_path("sub/"), filename ) + MPXPCtx->subtitles=sub_read_file( filename ? sub_filename( get_path("sub/"), filename ) : "default.sub", sh_video->fps ); } - if(mp_data->subtitles) { + if(MPXPCtx->subtitles) { priv->inited_flags|=INITED_SUBTITLE; - if(stream_dump_type>1) list_sub_file(mp_data->subtitles); + if(stream_dump_type>1) list_sub_file(MPXPCtx->subtitles); } #endif } @@ -1092,7 +1092,7 @@ static void mpxp_find_acodec(void) { int found=0; any_t* mpca=0; - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->priv); + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->priv); sh_audio_t* sh_audio=reinterpret_cast<sh_audio_t*>(priv->demuxer->audio->sh); demux_stream_t *d_audio=priv->demuxer->audio; sh_audio->codec=NULL; @@ -1142,7 +1142,7 @@ } static MPXP_Rc mpxp_find_vcodec(void) { - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->priv); + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->priv); demux_stream_t *d_video=priv->demuxer->video; sh_video_t* sh_video=reinterpret_cast<sh_video_t*>(priv->demuxer->video->sh); MPXP_Rc rc=MPXP_Ok; @@ -1198,7 +1198,7 @@ } static int mpxp_configure_audio(void) { - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->priv); + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->priv); sh_audio_t* sh_audio=reinterpret_cast<sh_audio_t*>(priv->demuxer->audio->sh); sh_video_t* sh_video=reinterpret_cast<sh_video_t*>(priv->demuxer->video->sh); demux_stream_t *d_audio=priv->demuxer->audio; @@ -1262,7 +1262,7 @@ } static void mpxp_run_ahead_engine(void) { - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->priv); + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->priv); sh_audio_t* sh_audio=reinterpret_cast<sh_audio_t*>(priv->demuxer->audio->sh); sh_video_t* sh_video=reinterpret_cast<sh_video_t*>(priv->demuxer->video->sh); MP_UNIT("init_xp"); @@ -1282,7 +1282,7 @@ } static void mpxp_print_audio_status(void) { - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->priv); + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->priv); sh_audio_t* sh_audio=reinterpret_cast<sh_audio_t*>(priv->demuxer->audio->sh); /* PAINT audio OSD */ unsigned ipts,rpts; @@ -1308,7 +1308,7 @@ #ifdef USE_OSD static int mpxp_paint_osd(int* osd_visible,int* in_pause) { - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->priv); + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->priv); const stream_t* stream=priv->demuxer->stream; sh_audio_t* sh_audio=reinterpret_cast<sh_audio_t*>(priv->demuxer->audio->sh); sh_video_t* sh_video=reinterpret_cast<sh_video_t*>(priv->demuxer->video->sh); @@ -1385,7 +1385,7 @@ }input_state_t; static int mpxp_handle_input(seek_args_t* seek,osd_args_t* osd,input_state_t* state) { - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->priv); + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->priv); stream_t* stream=priv->demuxer->stream; sh_video_t* sh_video=reinterpret_cast<sh_video_t*>(priv->demuxer->video->sh); int v_bright=0; @@ -1652,7 +1652,7 @@ secure_keys=ptr_protector.protect(new MPXPSecureKeys(10)); mpxp_init_structs(); - priv_t*priv=reinterpret_cast<priv_t*>(mp_data->priv); + priv_t*priv=reinterpret_cast<priv_t*>(MPXPCtx->priv); vo_data=vo_preinit_structs(); init_signal_handling(); @@ -1667,13 +1667,13 @@ priv->playtree = play_tree_new(); - mp_data->mconfig = m_config_new(priv->playtree,priv->libinput); - m_config_register_options(mp_data->mconfig,mplayer_opts); + MPXPCtx->mconfig = m_config_new(priv->playtree,priv->libinput); + m_config_register_options(MPXPCtx->mconfig,mplayer_opts); // TODO : add something to let modules register their options - mp_register_options(mp_data->mconfig); - parse_cfgfiles(mp_data->mconfig); + mp_register_options(MPXPCtx->mconfig); + parse_cfgfiles(MPXPCtx->mconfig); - if(m_config_parse_command_line(mp_data->mconfig, argc, argv, envp)!=MPXP_Ok) + if(m_config_parse_command_line(MPXPCtx->mconfig, argc, argv, envp)!=MPXP_Ok) exit_player("Error parse command line"); // error parsing cmdline if(!mp_conf.xp) { @@ -1700,7 +1700,7 @@ priv->playtree = play_tree_cleanup(priv->playtree); if(priv->playtree) { - playtree_iter = play_tree_iter_new(priv->playtree,mp_data->mconfig); + playtree_iter = play_tree_iter_new(priv->playtree,MPXPCtx->mconfig); if(playtree_iter) { if(play_tree_iter_step(playtree_iter,0,0) != PLAY_TREE_ITER_ENTRY) { play_tree_iter_free(playtree_iter); @@ -1905,11 +1905,11 @@ MPXP_Rc rc; unsigned quality; rc=mpcv_get_quality_max(sh_video->decoder,&quality); - if(rc==MPXP_Ok) mp_data->output_quality=quality; - if(mp_conf.autoq>mp_data->output_quality) mp_conf.autoq=mp_data->output_quality; - else mp_data->output_quality=mp_conf.autoq; - MSG_V("AutoQ: setting quality to %d\n",mp_data->output_quality); - mpcv_set_quality(sh_video->decoder,mp_data->output_quality); + if(rc==MPXP_Ok) MPXPCtx->output_quality=quality; + if(mp_conf.autoq>MPXPCtx->output_quality) mp_conf.autoq=MPXPCtx->output_quality; + else MPXPCtx->output_quality=mp_conf.autoq; + MSG_V("AutoQ: setting quality to %d\n",MPXPCtx->output_quality); + mpcv_set_quality(sh_video->decoder,MPXPCtx->output_quality); } vf_showlist(reinterpret_cast<vf_instance_t*>(sh_video->vfilter)); @@ -1938,9 +1938,9 @@ d_video->demuxer->file_format == DEMUXER_TYPE_H264_ES || d_video->demuxer->file_format == DEMUXER_TYPE_MPEG_PS || d_video->demuxer->file_format == DEMUXER_TYPE_MPEG_TS))) - mp_data->use_pts_fix2=1; + MPXPCtx->use_pts_fix2=1; else - mp_data->use_pts_fix2=0; + MPXPCtx->use_pts_fix2=0; if(sh_video) sh_video->chapter_change=0; @@ -1973,13 +1973,13 @@ } /* Init timers and benchmarking */ - mp_data->rtc_fd=InitTimer(); - if(!mp_conf.nortc && mp_data->rtc_fd>0) { close(mp_data->rtc_fd); mp_data->rtc_fd=-1; } - MSG_V("Using %s timing\n",mp_data->rtc_fd>0?"rtc":mp_conf.softsleep?"software":"usleep()"); + MPXPCtx->rtc_fd=InitTimer(); + if(!mp_conf.nortc && MPXPCtx->rtc_fd>0) { close(MPXPCtx->rtc_fd); MPXPCtx->rtc_fd=-1; } + MSG_V("Using %s timing\n",MPXPCtx->rtc_fd>0?"rtc":mp_conf.softsleep?"software":"usleep()"); - mp_data->bench->total_start=GetTimer(); - mp_data->bench->audio=0; mp_data->bench->audio_decode=0; mp_data->bench->video=0; - mp_data->bench->audio_decode_correction=0; + MPXPCtx->bench->total_start=GetTimer(); + MPXPCtx->bench->audio=0; MPXPCtx->bench->audio_decode=0; MPXPCtx->bench->video=0; + MPXPCtx->bench->audio_decode_correction=0; if(mp_conf.benchmark) init_benchmark(); @@ -1994,7 +1994,7 @@ let thread will decode ahead! We may print something in block window ;) */ - mp_data->seek_time = GetTimerMS(); + MPXPCtx->seek_time = GetTimerMS(); if(sh_video) dae_wait_decoder_outrun(xp_core->video); Modified: mplayerxp/mplayerxp.h =================================================================== --- mplayerxp/mplayerxp.h 2012-11-15 14:18:24 UTC (rev 373) +++ mplayerxp/mplayerxp.h 2012-11-15 14:34:45 UTC (rev 374) @@ -106,7 +106,7 @@ }time_usage_t; /* non-configurable through command line stuff */ -typedef struct mp_data_s { +typedef struct MPXPContext_s { int rtc_fd; int seek_time; int output_quality; @@ -118,8 +118,8 @@ time_usage_t*bench; any_t* priv; any_t* msg_priv; -}mp_data_t; -extern mp_data_t* mp_data; +}MPXPContext_t; +extern MPXPContext_t* MPXPCtx; extern void update_osd( float v_pts ); Modified: mplayerxp/xmpcore/xmp_adecoder.cpp =================================================================== --- mplayerxp/xmpcore/xmp_adecoder.cpp 2012-11-15 14:18:24 UTC (rev 373) +++ mplayerxp/xmpcore/xmp_adecoder.cpp 2012-11-15 14:34:45 UTC (rev 374) @@ -304,12 +304,12 @@ pthread_cond_signal( &audio_buffer.wait_buffer_cond ); t=GetTimer()-t; - mp_data->bench->audio_decode+=t*0.000001f; - mp_data->bench->audio_decode-=mp_data->bench->audio_decode_correction; + MPXPCtx->bench->audio_decode+=t*0.000001f; + MPXPCtx->bench->audio_decode-=MPXPCtx->bench->audio_decode_correction; if(mp_conf.benchmark) { - if(t > mp_data->bench->max_audio_decode) mp_data->bench->max_audio_decode = t; - if(t < mp_data->bench->min_audio_decode) mp_data->bench->min_audio_decode = t; + if(t > MPXPCtx->bench->max_audio_decode) MPXPCtx->bench->max_audio_decode = t; + if(t < MPXPCtx->bench->min_audio_decode) MPXPCtx->bench->min_audio_decode = t; } pthread_mutex_unlock( &audio_buffer.head_mutex ); Modified: mplayerxp/xmpcore/xmp_aplayer.cpp =================================================================== --- mplayerxp/xmpcore/xmp_aplayer.cpp 2012-11-15 14:18:24 UTC (rev 373) +++ mplayerxp/xmpcore/xmp_aplayer.cpp 2012-11-15 14:34:45 UTC (rev 374) @@ -71,12 +71,12 @@ MP_UNIT("play_audio"); // Leave AUDIO decoder module t=GetTimer()-t; tt = t*0.000001f; - mp_data->bench->audio+=tt; + MPXPCtx->bench->audio+=tt; if(mp_conf.benchmark) { - if(tt > mp_data->bench->max_audio) mp_data->bench->max_audio = tt; - if(tt < mp_data->bench->min_audio) mp_data->bench->min_audio = tt; - mp_data->bench->cur_audio=tt; + if(tt > MPXPCtx->bench->max_audio) MPXPCtx->bench->max_audio = tt; + if(tt < MPXPCtx->bench->min_audio) MPXPCtx->bench->min_audio = tt; + MPXPCtx->bench->cur_audio=tt; } if(playsize>sh_audio->a_buffer_len) playsize=sh_audio->a_buffer_len; @@ -89,7 +89,7 @@ memcpy(sh_audio->a_buffer,&sh_audio->a_buffer[playsize],sh_audio->a_buffer_len); if(!mp_conf.av_sync_pts && xmp_test_model(XMP_Run_AudioPlayer)) pthread_mutex_lock(&audio_timer_mutex); - if(mp_data->use_pts_fix2) { + if(MPXPCtx->use_pts_fix2) { if(sh_audio->a_pts != HUGE) { sh_audio->a_pts_pos-=playsize; if(sh_audio->a_pts_pos > -ao_get_delay(ao_data)*sh_audio->af_bps) { Modified: mplayerxp/xmpcore/xmp_vdecoder.cpp =================================================================== --- mplayerxp/xmpcore/xmp_vdecoder.cpp 2012-11-15 14:18:24 UTC (rev 373) +++ mplayerxp/xmpcore/xmp_vdecoder.cpp 2012-11-15 14:34:45 UTC (rev 374) @@ -40,7 +40,7 @@ float screen_pts=dae_played_frame(xp_core->video).v_pts-(mp_conf.av_sync_pts?0:xp_core->initial_apts); static float prev_delta=64; float delta,max_frame_delay;/* delay for decoding of top slow frame */ - max_frame_delay = mp_data->bench->max_video+mp_data->bench->max_vout; + max_frame_delay = MPXPCtx->bench->max_video+MPXPCtx->bench->max_vout; /* TODO: @@ -134,7 +134,7 @@ if(!xmp_test_model(XMP_Run_VA_Decoder) && xp_core->audio) priv->name = "video decoder"; drop_barrier=(float)(xp_core->num_v_buffs/2)*(1/sh_video->fps); - if(mp_conf.av_sync_pts == -1 && !mp_data->use_pts_fix2) + if(mp_conf.av_sync_pts == -1 && !MPXPCtx->use_pts_fix2) xp_core->bad_pts = d_video->demuxer->file_format == DEMUXER_TYPE_MPEG_ES || d_video->demuxer->file_format == DEMUXER_TYPE_MPEG4_ES || d_video->demuxer->file_format == DEMUXER_TYPE_H264_ES || @@ -186,7 +186,7 @@ int cur_time; cur_time = GetTimerMS(); /* Ugly solution: disable frame dropping right after seeking! */ - if(cur_time - mp_data->seek_time > (xp_core->num_v_buffs/sh_video->fps)*100) xp_n_frame_to_drop=compute_frame_dropping(sh_video,frame->pts,drop_barrier); + if(cur_time - MPXPCtx->seek_time > (xp_core->num_v_buffs/sh_video->fps)*100) xp_n_frame_to_drop=compute_frame_dropping(sh_video,frame->pts,drop_barrier); } /* if( mp_conf.frame_dropping ) */ if(!finite(frame->pts)) MSG_WARN("Bug of demuxer! Value of video pts=%f\n",frame->pts); if(frame->type!=VideoFrame) escape_player("VideoDecoder doesn't parse non video frames",mp_conf.max_trace); @@ -205,11 +205,11 @@ if(xp_n_frame_to_drop) drop_param=mp_conf.frame_dropping; else drop_param=0; /* decode: */ - if(mp_data->output_quality) { + if(MPXPCtx->output_quality) { unsigned total = xp_core->num_v_buffs/2; unsigned distance = dae_get_decoder_outrun(xp_core->video); int our_quality; - our_quality = mp_data->output_quality*distance/total; + our_quality = MPXPCtx->output_quality*distance/total; if(drop_param) mpcv_set_quality(sh_video->decoder,0); else if(mp_conf.autoq) mpcv_set_quality(sh_video->decoder,our_quality>0?our_quality:0); @@ -217,8 +217,8 @@ frame->flags=drop_param; blit_frame=RND_RENAME4(mpcv_decode)(sh_video->decoder,frame); MSG_DBG2("DECODER: %i[%i] %f\n",dae_curr_vdecoded(xp_core),frame->len,frame->pts); - if(mp_data->output_quality) { - if(drop_param) mpcv_set_quality(sh_video->decoder,mp_data->output_quality); + if(MPXPCtx->output_quality) { + if(drop_param) mpcv_set_quality(sh_video->decoder,MPXPCtx->output_quality); } if(!blit_frame && drop_param) priv->dae->num_dropped_frames++; if(blit_frame) { Modified: mplayerxp/xmpcore/xmp_vplayer.cpp =================================================================== --- mplayerxp/xmpcore/xmp_vplayer.cpp 2012-11-15 14:18:24 UTC (rev 373) +++ mplayerxp/xmpcore/xmp_vplayer.cpp 2012-11-15 14:34:45 UTC (rev 374) @@ -29,10 +29,10 @@ MSG_STATUS("A:%6.1f V:%6.1f A-V:%7.3f %3d/%3d %2d%% %2d%% %4.1f%% %d [frms: [%i]]\n", a_pts-delay,v_pts,AV_delay ,xp_core->video->num_played_frames,xp_core->video->num_decoded_frames - ,(v_pts>0.5)?(int)(100.0*mp_data->bench->video/(double)v_pts):0 - ,(v_pts>0.5)?(int)(100.0*mp_data->bench->vout/(double)v_pts):0 - ,(v_pts>0.5)?(100.0*(mp_data->bench->audio+mp_data->bench->audio_decode)/(double)v_pts):0 - ,mp_data->output_quality + ,(v_pts>0.5)?(int)(100.0*MPXPCtx->bench->video/(double)v_pts):0 + ,(v_pts>0.5)?(int)(100.0*MPXPCtx->bench->vout/(double)v_pts):0 + ,(v_pts>0.5)?(100.0*(MPXPCtx->bench->audio+MPXPCtx->bench->audio_decode)/(double)v_pts):0 + ,MPXPCtx->output_quality ,dae_curr_vplayed(xp_core) ); fflush(stdout); @@ -47,26 +47,26 @@ ,a_pts-v_pts ,0.0 ,xp_core->video->num_played_frames,xp_core->video->num_decoded_frames - ,(v_pts>0.5)?(int)(100.0*mp_data->bench->video/(double)v_pts):0 - ,(v_pts>0.5)?(int)(100.0*mp_data->bench->vout/(double)v_pts):0 - ,(v_pts>0.5)?(100.0*(mp_data->bench->audio+mp_data->bench->audio_decode)/(double)v_pts):0 - ,mp_data->output_quality + ,(v_pts>0.5)?(int)(100.0*MPXPCtx->bench->video/(double)v_pts):0 + ,(v_pts>0.5)?(int)(100.0*MPXPCtx->bench->vout/(double)v_pts):0 + ,(v_pts>0.5)?(100.0*(MPXPCtx->bench->audio+MPXPCtx->bench->audio_decode)/(double)v_pts):0 + ,MPXPCtx->output_quality ); } else MSG_STATUS("V:%6.1f %3d %2d%% %2d%% %4.1f%% %d\r" ,v_pts ,xp_core->video->num_played_frames - ,(v_pts>0.5)?(int)(100.0*mp_data->bench->video/(double)v_pts):0 - ,(v_pts>0.5)?(int)(100.0*mp_data->bench->vout/(double)v_pts):0 - ,(v_pts>0.5)?(100.0*(mp_data->bench->audio+mp_data->bench->audio_decode)/(double)v_pts):0 - ,mp_data->output_quality + ,(v_pts>0.5)?(int)(100.0*MPXPCtx->bench->video/(double)v_pts):0 + ,(v_pts>0.5)?(int)(100.0*MPXPCtx->bench->vout/(double)v_pts):0 + ,(v_pts>0.5)?(100.0*(MPXPCtx->bench->audio+MPXPCtx->bench->audio_decode)/(double)v_pts):0 + ,MPXPCtx->output_quality ); fflush(stdout); } static void vplayer_check_chapter_change(sh_audio_t* sh_audio,sh_video_t* sh_video,xmp_frame_t* shva_prev,float v_pts) { - if(mp_data->use_pts_fix2 && sh_audio) { + if(MPXPCtx->use_pts_fix2 && sh_audio) { if(sh_video->chapter_change == -1) { /* First frame after seek */ while(v_pts < 1.0 && sh_audio->timer==0.0 && ao_get_delay(ao_data)==0.0) usleep(0); /* Wait for audio to start play */ @@ -96,10 +96,10 @@ often ao_get_delay() never returns 0 :( */ if(xp_core->audio->eof && !get_delay_audio_buffer()) goto nosound_model; if((!xp_core->audio->eof || ao_get_delay(ao_data)) && - (!mp_data->use_pts_fix2 || (!sh_audio->chapter_change && !sh_video->chapter_change))) + (!MPXPCtx->use_pts_fix2 || (!sh_audio->chapter_change && !sh_video->chapter_change))) sleep_time=screen_pts-((sh_audio->timer-ao_get_delay(ao_data)) +(mp_conf.av_sync_pts?0:xp_core->initial_apts)); - else if(mp_data->use_pts_fix2 && sh_audio->chapter_change) + else if(MPXPCtx->use_pts_fix2 && sh_audio->chapter_change) sleep_time=0; else goto nosound_model; @@ -192,7 +192,7 @@ static int drop_message=0; if(!drop_message && xp_core->video->num_slow_frames > 50) { drop_message=1; - if(mp_data->mpxp_after_seek) mp_data->mpxp_after_seek--; + if(MPXPCtx->mpxp_after_seek) MPXPCtx->mpxp_after_seek--; else MSG_WARN(MSGTR_SystemTooSlow); } MSG_D("\ndec_ahead_main: stalling: %i %i\n",dae_cuurr_vplayed(),dae_curr_decoded()); @@ -211,7 +211,7 @@ sleep_time=vplayer_compute_sleep_time(sh_audio,sh_video,&shva_prev,v_pts); if(!(vo_data->flags&256)){ /* flag 256 means: libvo driver does its timing (dvb card) */ - if(!vplayer_do_sleep(sh_audio,mp_data->rtc_fd,sleep_time)) return 0; + if(!vplayer_do_sleep(sh_audio,MPXPCtx->rtc_fd,sleep_time)) return 0; } player_idx=dae_next_played(xp_core->video); @@ -220,10 +220,10 @@ MSG_D("\ndec_ahead_main: schedule %u on screen\n",player_idx); t2=GetTimer()-t2; tt = t2*0.000001f; - mp_data->bench->vout+=tt; + MPXPCtx->bench->vout+=tt; if(mp_conf.benchmark) { /* we need compute draw_slice+change_frame here */ - mp_data->bench->cur_vout+=tt; + MPXPCtx->bench->cur_vout+=tt; } } MP_UNIT(NULL); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |