[Mplayerxp-cvslog] SF.net SVN: mplayerxp:[165] mplayerxp
Brought to you by:
olov
From: <nic...@us...> - 2012-10-16 17:42:57
|
Revision: 165 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=165&view=rev Author: nickols_k Date: 2012-10-16 17:42:50 +0000 (Tue, 16 Oct 2012) Log Message: ----------- minor improvements Modified Paths: -------------- mplayerxp/Makefile mplayerxp/configure mplayerxp/dec_ahead.c mplayerxp/fifo.c mplayerxp/fifo.h mplayerxp/libvo/video_out.h mplayerxp/libvo/vo_opengl.c mplayerxp/libvo/vo_x11.c mplayerxp/libvo/vo_xv.c mplayerxp/libvo/vo_xvidix.c mplayerxp/libvo/x11_common.c mplayerxp/mplayer.c Modified: mplayerxp/Makefile =================================================================== --- mplayerxp/Makefile 2012-10-16 16:31:36 UTC (rev 164) +++ mplayerxp/Makefile 2012-10-16 17:42:50 UTC (rev 165) @@ -24,7 +24,7 @@ LDFLAGS += -Wl,-rpath,${CODECDIR}/codecs SRCS_COMMON = cpudetect.c mp_msg.c codec-cfg.c cfgparser.c my_profile.c my_malloc.c spudec.c playtree.c playtreeparser.c asxparser.c mp_image.c subopt-helper.c -SRCS_MPLAYER = mplayer.c $(SRCS_COMMON) find_sub.c subreader.c mixer.c vobsub.c mp-opt-reg.c sig_hand.c dump.c dec_ahead.c m_option.c m_property.c m_struct.c +SRCS_MPLAYER = mplayer.c fifo.c $(SRCS_COMMON) find_sub.c subreader.c mixer.c vobsub.c mp-opt-reg.c sig_hand.c dump.c dec_ahead.c m_option.c m_property.c m_struct.c OBJS_MPLAYER = $(SRCS_MPLAYER:.c=.o) Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2012-10-16 16:31:36 UTC (rev 164) +++ mplayerxp/configure 2012-10-16 17:42:50 UTC (rev 165) @@ -712,7 +712,7 @@ enabled libbz2 && require2 libbz2 bzlib.h BZ2_bzlibVersion -lbz2 || disable libbz2 print_config HAVE_ mp_config.h mp_config.mak libbz2 -CFLAGS="$CFLAGS -W -Wall" +CFLAGS="$CFLAGS -W -Wall -Wextra -Wshadow" # Thread support if linux ; then CFLAGS="$CFLAGS -D_REENTRANT" Modified: mplayerxp/dec_ahead.c =================================================================== --- mplayerxp/dec_ahead.c 2012-10-16 16:31:36 UTC (rev 164) +++ mplayerxp/dec_ahead.c 2012-10-16 17:42:50 UTC (rev 165) @@ -135,20 +135,20 @@ int drop_param=0; volatile unsigned da_active_frame,lda_active_frame,ada_active_frame; unsigned xp_n_frame_to_drop; - int xp_id; + int _xp_id; static float prev_delta=0; float v_pts,mpeg_timer=HUGE; pthread_is_living=1; xp_eof = 0; xp_audio_eof=0; MSG_T("\nDEC_AHEAD: entering...\n"); - xp_id=init_signal_handling(sig_dec_ahead_video,uninit_dec_ahead); - pinfo[xp_id].current_module = "dec_ahead"; + _xp_id=init_signal_handling(sig_dec_ahead_video,uninit_dec_ahead); + pinfo[_xp_id].current_module = "dec_ahead"; dec_ahead_pid = - pinfo[xp_id].pid = getpid(); /* Only for testing */ + pinfo[_xp_id].pid = getpid(); /* Only for testing */ dec_ahead_pth_id = - pinfo[xp_id].pth_id = pthread_self(); - pinfo[xp_id].thread_name = (has_xp_audio && enable_xp < XP_VAFull) ? "video+audio decoding+filtering ahead" : "video decoding+vf ahead"; + pinfo[_xp_id].pth_id = pthread_self(); + pinfo[_xp_id].thread_name = (has_xp_audio && enable_xp < XP_VAFull) ? "video+audio decoding+filtering ahead" : "video decoding+vf ahead"; prev_delta=xp_num_frames; drop_barrier=(float)(xp_num_frames/2)*(1/vo.fps); if(av_sync_pts == -1 && !use_pts_fix2) @@ -165,13 +165,13 @@ { unsigned char* start=NULL; int in_size; if(dec_ahead_in_lseek==PreSeek) { - pinfo[xp_id].current_module = "Pre seek"; + pinfo[_xp_id].current_module = "Pre seek"; LOCK_VIDEO_DECODE(); dec_ahead_in_lseek=Seek; pthread_cond_wait( &video_decode_cond, &video_decode_mutex ); UNLOCK_VIDEO_DECODE(); } - pinfo[xp_id].current_module = "dec_ahead 1"; + pinfo[_xp_id].current_module = "dec_ahead 1"; /* get it! */ LOCK_VREADING(); if(dec_ahead_in_lseek==Seek) @@ -183,15 +183,15 @@ /* prevent reent access to non-reent demuxer */ //if(sh_video->num_frames>200) *((char*)0x100) = 1; // Testing crash if(has_xp_audio && enable_xp<XP_VAFull) { - pinfo[xp_id].current_module = "decode audio"; + pinfo[_xp_id].current_module = "decode audio"; while(2==xp_thread_decode_audio()) ; - pinfo[xp_id].current_module = "dec_ahead 2"; + pinfo[_xp_id].current_module = "dec_ahead 2"; } in_size=video_read_frame_r(sh_video,&duration,&v_pts,&start,vo.fps); UNLOCK_VREADING(); if(dec_ahead_in_lseek==Seek) { - pinfo[xp_id].current_module = "Post seek"; + pinfo[_xp_id].current_module = "Post seek"; /* reset counters */ vo_get_active_frame(&dec_ahead_locked_frame); LOCK_VDEC_ACTIVE(); @@ -204,7 +204,7 @@ if(xp_is_bad_pts) mpeg_timer=HUGE; dec_ahead_in_lseek=NoSeek; MSG_T("\nDEC_AHEAD: reset counters to (%u %u) due lseek\n",dec_ahead_locked_frame,abs_dec_ahead_locked_frame); - pinfo[xp_id].current_module = "dec_ahead 3"; + pinfo[_xp_id].current_module = "dec_ahead 3"; } if(in_size<0) { @@ -212,10 +212,10 @@ xp_eof=1; if(has_xp_audio && enable_xp<XP_VAFull) { while(!xp_audio_eof && !dec_ahead_in_lseek && !pthread_end_of_work) { - pinfo[xp_id].current_module = "decode audio"; + pinfo[_xp_id].current_module = "decode audio"; if(!xp_thread_decode_audio()) usleep(1); - pinfo[xp_id].current_module = NULL; + pinfo[_xp_id].current_module = NULL; } if(dec_ahead_in_lseek) { xp_eof=0; @@ -224,7 +224,7 @@ } LOCK_VIDEO_DECODE(); if(!pthread_end_of_work) { - pinfo[xp_id].current_module = "wait for end of work"; + pinfo[_xp_id].current_module = "wait for end of work"; pthread_cond_wait(&video_decode_cond,&video_decode_mutex); } UNLOCK_VIDEO_DECODE(); @@ -334,9 +334,9 @@ if(pthread_end_of_work) goto pt_exit; if(dec_ahead_in_lseek!=NoSeek) break; if(has_xp_audio && enable_xp<XP_VAFull) { - pinfo[xp_id].current_module = "decode audio"; + pinfo[_xp_id].current_module = "decode audio"; xp_thread_decode_audio(); - pinfo[xp_id].current_module = "dec_ahead 5"; + pinfo[_xp_id].current_module = "dec_ahead 5"; } usleep(1); LOCK_VDEC_ACTIVE(); @@ -465,7 +465,7 @@ MSG_T("\nDEC_AHEAD: leaving...\n"); pthread_is_living=0; pthread_end_of_work=0; - uninit_signal_handling(xp_id); + uninit_signal_handling(_xp_id); return arg; /* terminate thread here !!! */ } Modified: mplayerxp/fifo.c =================================================================== --- mplayerxp/fifo.c 2012-10-16 16:31:36 UTC (rev 164) +++ mplayerxp/fifo.c 2012-10-16 17:42:50 UTC (rev 165) @@ -1,10 +1,14 @@ #include "fifo.h" +#ifndef min +#define min(a,b) ((a)<(b)?(a):(b)) +#endif + // keyboard: -static int keyb_fifo_put=-1; -static int keyb_fifo_get=-1; +int keyb_fifo_put=-1; +int keyb_fifo_get=-1; -static void __FASTCALL__ make_pipe(int* pr,int* pw){ +void __FASTCALL__ fifo_make_pipe(int* pr,int* pw){ int temp[2]; if(pipe(temp)!=0) MSG_ERR("Cannot make PIPE!\n"); *pr=temp[0]; @@ -129,7 +133,6 @@ return total - size; } - int cb_fifo_generic_read(CBFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int)) { // Read memory barrier needed for SMP here in theory Modified: mplayerxp/fifo.h =================================================================== --- mplayerxp/fifo.h 2012-10-16 16:31:36 UTC (rev 164) +++ mplayerxp/fifo.h 2012-10-16 17:42:50 UTC (rev 165) @@ -2,8 +2,22 @@ * @file libavutil/fifo.h * a very simple circular buffer FIFO implementation */ +#include "mp_config.h" +#define MSGT_CLASS MSGT_GLOBAL +#include "__mp_msg.h" + #include <stdint.h> +#include <stddef.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +// keyboard: +extern int keyb_fifo_put; +extern int keyb_fifo_get; + +extern void __FASTCALL__ fifo_make_pipe(int* pr,int* pw); + typedef struct CBFifoBuffer { uint8_t *buffer; uint8_t *rptr, *wptr, *end; Modified: mplayerxp/libvo/video_out.h =================================================================== --- mplayerxp/libvo/video_out.h 2012-10-16 16:31:36 UTC (rev 164) +++ mplayerxp/libvo/video_out.h 2012-10-16 17:42:50 UTC (rev 165) @@ -188,7 +188,11 @@ extern uint32_t __FASTCALL__ vo_control(uint32_t request, void *data); extern int __FASTCALL__ vo_is_final(void); -struct vo_rect { +typedef struct vo_rect_s { + unsigned x,y,w,h; +}vo_rect_t; + +struct vo_rect2 { int left, right, top, bottom, width, height; }; @@ -235,16 +239,10 @@ unsigned screenheight; // requested resolution/bpp: (-x -y -bpp options) - unsigned dx; - unsigned dy; - unsigned dwidth; - unsigned dheight; + vo_rect_t dest; unsigned dbpp; - unsigned old_x; - unsigned old_y; - unsigned old_width; - unsigned old_height; + vo_rect_t prev; int doublebuffering; int vsync; Modified: mplayerxp/libvo/vo_opengl.c =================================================================== --- mplayerxp/libvo/vo_opengl.c 2012-10-16 16:31:36 UTC (rev 164) +++ mplayerxp/libvo/vo_opengl.c 2012-10-16 17:42:50 UTC (rev 165) @@ -175,7 +175,7 @@ vo.fs=flags&VOFLAG_FULLSCREEN; vo.softzoom=flags&VOFLAG_SWSCALE; if ( vo.fs ) - { vo.old_width=d_width; vo.old_height=d_height; } + { vo.prev.w=d_width; vo.prev.h=d_height; } #ifdef HAVE_XF86VM if( flags&0x02 ) vm = 1; @@ -289,7 +289,7 @@ static uint32_t __FASTCALL__ check_events(int (* __FASTCALL__ adjust_size)(unsigned cw,unsigned ch,unsigned *w,unsigned *h)) { int e=vo_x11_check_events(vo.mDisplay,adjust_size); - if(e&VO_EVENT_RESIZE) resize(vo.dwidth,vo.dheight); + if(e&VO_EVENT_RESIZE) resize(vo.dest.w,vo.dest.h); return e|VO_EVENT_FORCE_UPDATE; } @@ -381,7 +381,7 @@ return query_format((vo_query_fourcc_t*)data); case VOCTRL_FULLSCREEN: vo_fullscreen(); - resize(vo.dwidth, vo.dheight); + resize(vo.dest.w, vo.dest.h); return VO_TRUE; case VOCTRL_GET_NUM_FRAMES: *(uint32_t *)data = vogl.num_buffers; Modified: mplayerxp/libvo/vo_x11.c =================================================================== --- mplayerxp/libvo/vo_x11.c 2012-10-16 16:31:36 UTC (rev 164) +++ mplayerxp/libvo/vo_x11.c 2012-10-16 17:42:50 UTC (rev 165) @@ -97,8 +97,8 @@ if (ret & VO_EVENT_RESIZE) { unsigned idx; - unsigned newW= vo.dwidth; - unsigned newH= vo.dheight; + unsigned newW= vo.dest.w; + unsigned newH= vo.dest.h; int newAspect= (newW*(1<<16) + (newH>>1))/newH; if(newAspect>vox11.baseAspect) newW= (newH*vox11.baseAspect + (1<<15))>>16; else newH= ((newW<<16) + (vox11.baseAspect>>1)) /vox11.baseAspect; @@ -169,8 +169,8 @@ bg=WhitePixel( vo.mDisplay,vo.mScreen ); fg=BlackPixel( vo.mDisplay,vo.mScreen ); - vo.dwidth=hint.width; - vo.dheight=hint.height; + vo.dest.w=hint.width; + vo.dest.h=hint.height; vox11.image_width=d_width; vox11.image_height=d_height; @@ -284,7 +284,7 @@ { XShmPutImage( vo.mDisplay,vo.window,vo.gc,myximage, 0,0, - ( vo.dwidth - myximage->width ) / 2,( vo.dheight - myximage->height ) / 2, + ( vo.dest.w - myximage->width ) / 2,( vo.dest.h - myximage->height ) / 2, myximage->width,myximage->height,True ); } else @@ -292,7 +292,7 @@ { XPutImage( vo.mDisplay,vo.window,vo.gc,myximage, 0,0, - ( vo.dwidth - myximage->width ) / 2,( vo.dheight - myximage->height ) / 2, + ( vo.dest.w - myximage->width ) / 2,( vo.dest.h - myximage->height ) / 2, myximage->width,myximage->height); } #endif Modified: mplayerxp/libvo/vo_xv.c =================================================================== --- mplayerxp/libvo/vo_xv.c 2012-10-16 16:31:36 UTC (rev 164) +++ mplayerxp/libvo/vo_xv.c 2012-10-16 17:42:50 UTC (rev 165) @@ -329,7 +329,7 @@ vo.fs=flags&VOFLAG_FULLSCREEN; vo.softzoom=flags&VOFLAG_SWSCALE; if ( vo.fs ) - { vo.old_width=d_width; vo.old_height=d_height; } + { vo.prev.w=d_width; vo.prev.h=d_height; } #ifdef HAVE_XF86VM if( flags&0x02 ) vm = 1; Modified: mplayerxp/libvo/vo_xvidix.c =================================================================== --- mplayerxp/libvo/vo_xvidix.c 2012-10-16 16:31:36 UTC (rev 164) +++ mplayerxp/libvo/vo_xvidix.c 2012-10-16 17:42:50 UTC (rev 165) @@ -224,7 +224,7 @@ vo.fs = flags&0x01; if (vo.fs) - { vo.old_width=d_width; vo.old_height=d_height; } + { vo.prev.w=d_width; vo.prev.h=d_height; } xvidix.X_already_started++; Modified: mplayerxp/libvo/x11_common.c =================================================================== --- mplayerxp/libvo/x11_common.c 2012-10-16 16:31:36 UTC (rev 164) +++ mplayerxp/libvo/x11_common.c 2012-10-16 17:42:50 UTC (rev 165) @@ -692,11 +692,11 @@ case ConfigureNotify: nw = Event.xconfigure.width; nh = Event.xconfigure.height; - if(adjust_size) adj_ret = (*adjust_size)(vo.dwidth,vo.dheight,&nw,&nh); - ow = vo.dwidth; - oh = vo.dheight; - vo.dwidth=nw; - vo.dheight=nh; + if(adjust_size) adj_ret = (*adjust_size)(vo.dest.w,vo.dest.h,&nw,&nh); + ow = vo.dest.w; + oh = vo.dest.h; + vo.dest.w=nw; + vo.dest.h=nh; { Window root; unsigned foo; @@ -704,14 +704,14 @@ XGetGeometry(mydisplay, vo.window, &root, &foo, &foo, &foo/*width*/, &foo/*height*/, &foo, &foo); XTranslateCoordinates(mydisplay, vo.window, root, 0, 0, - &vo.dx, &vo.dy, &win); + &vo.dest.x, &vo.dest.y, &win); } - if(adjust_size && ow != vo.dwidth && oh != vo.dheight && adj_ret) + if(adjust_size && ow != vo.dest.w && oh != vo.dest.h && adj_ret) { - XResizeWindow( vo.mDisplay,vo.window,vo.dwidth,vo.dheight ); + XResizeWindow( vo.mDisplay,vo.window,vo.dest.w,vo.dest.h ); XSync( vo.mDisplay,True); } - MSG_V("X11 Window %dx%d-%dx%d\n", vo.dx, vo.dy, vo.dwidth, vo.dheight); + MSG_V("X11 Window %dx%d-%dx%d\n", vo.dest.x, vo.dest.y, vo.dest.w, vo.dest.h); ret|=VO_EVENT_RESIZE; break; case KeyPress: @@ -793,18 +793,18 @@ if ( !vo.fs ) { vo.fs=VO_TRUE; - vo.old_x=vo.dx; vo.old_y=vo.dy; vo.old_width=vo.dwidth; vo.old_height=vo.dheight; - vo.dx=0; vo.dy=0; vo.dwidth=vo.screenwidth; vo.dheight=vo.screenheight; + vo.prev=vo.dest; + vo.dest.x=0; vo.dest.y=0; vo.dest.w=vo.screenwidth; vo.dest.h=vo.screenheight; vo_x11_decoration( vo.mDisplay,vo.window,0 ); } else { vo.fs=VO_FALSE; - vo.dx=vo.old_x; vo.dy=vo.old_y; vo.dwidth=vo.old_width; vo.dheight=vo.old_height; + vo.dest=vo.prev; vo_x11_decoration( vo.mDisplay,vo.window,1 ); } - vo_x11_sizehint( vo.dx,vo.dy,vo.dwidth,vo.dheight ); - XMoveResizeWindow( vo.mDisplay,vo.window,vo.dx,vo.dy,vo.dwidth,vo.dheight ); + vo_x11_sizehint( vo.dest.x,vo.dest.y,vo.dest.w,vo.dest.h ); + XMoveResizeWindow( vo.mDisplay,vo.window,vo.dest.x,vo.dest.y,vo.dest.w,vo.dest.h ); XMapWindow( vo.mDisplay,vo.window ); XSync( vo.mDisplay,False ); } Modified: mplayerxp/mplayer.c =================================================================== --- mplayerxp/mplayer.c 2012-10-16 16:31:36 UTC (rev 164) +++ mplayerxp/mplayer.c 2012-10-16 17:42:50 UTC (rev 165) @@ -168,7 +168,7 @@ #include "libmpcodecs/dec_audio.h" /* Common FIFO functions, and keyboard/event FIFO code */ -#include "fifo.c" +#include "fifo.h" int use_stdin=0; /**************************************************************************/ @@ -327,7 +327,7 @@ audio_buffer_t audio_buffer; -int init_audio_buffer( int size, int min_reserv, int indices, sh_audio_t *sh_audio ) +int init_audio_buffer( int size, int min_reserv, int indices, sh_audio_t *sha ) { MSG_V("Using audio buffer %i bytes (min reserve = %i, indices %i)\n",size,min_reserv, indices); if( !(audio_buffer.buffer = malloc(size)) ) @@ -352,7 +352,7 @@ pthread_mutex_init( &audio_buffer.head_mutex, NULL); pthread_mutex_init( &audio_buffer.tail_mutex, NULL); pthread_cond_init( &audio_buffer.wait_buffer_cond, NULL); - audio_buffer.sh_audio = sh_audio; + audio_buffer.sh_audio = sha; return 0; } @@ -766,7 +766,6 @@ if(sh_audio) while(get_len_audio_buffer()) usleep(0); if(sh_video && shva) { - volatile int dec_ahead_active_frame; for(;;) { __MP_SYNCHRONIZE(vdec_active_mutex,vo_get_active_frame(&dec_ahead_active_frame)); @@ -1042,7 +1041,7 @@ list_codecs(1); } -int decore_audio( int xp_id ) +int decore_audio( int _xp_id ) { int eof = 0; /*========================== PLAY AUDIO ============================*/ @@ -1067,7 +1066,7 @@ //if(playsize>outburst) playsize=outburst; // Update buffer if needed - pinfo[xp_id].current_module="decode_audio"; // Enter AUDIO decoder module + pinfo[_xp_id].current_module="decode_audio"; // Enter AUDIO decoder module t=GetTimer(); while(sh_audio->a_buffer_len<playsize && !audio_eof){ if(enable_xp>=XP_VideoAudio) { @@ -1088,14 +1087,14 @@ { MSG_V("audio_stream_eof\n"); inited_flags&=~INITED_AO; - pinfo[xp_id].current_module="uninit_ao"; + pinfo[_xp_id].current_module="uninit_ao"; ao_uninit(); } audio_eof=1; break; } } - pinfo[xp_id].current_module="play_audio"; // Leave AUDIO decoder module + pinfo[_xp_id].current_module="play_audio"; // Leave AUDIO decoder module t=GetTimer()-t; tt = t*0.000001f; audio_time_usage+=tt; @@ -1820,7 +1819,7 @@ return 0; } -void mpxp_seek( int xp_id, video_stat_t *vstat, int *osd_visible,float v_pts,float pos,int flags) +void mpxp_seek( int _xp_id, video_stat_t *vstat, int *osd_visible,float v_pts,float pos,int flags) { int seek_rval=1; audio_eof=0; @@ -1858,20 +1857,20 @@ fflush(stdout); if(sh_video){ - pinfo[xp_id].current_module="seek_video_reset"; + pinfo[_xp_id].current_module="seek_video_reset"; resync_video_stream(sh_video); vo_reset(); sh_video->chapter_change=-1; } if(sh_audio){ - pinfo[xp_id].current_module="seek_audio_reset"; + pinfo[_xp_id].current_module="seek_audio_reset"; resync_audio_stream(sh_audio); ao_reset(); // stop audio, throwing away buffered data } if (vo.vobsub) { - pinfo[xp_id].current_module = "seek_vobsub_reset"; + pinfo[_xp_id].current_module = "seek_vobsub_reset"; vobsub_seek(vo.vobsub, v_pts); } @@ -2190,7 +2189,7 @@ #endif // ========== Init keyboard FIFO (connection to libvo) ============ -make_pipe(&keyb_fifo_get,&keyb_fifo_put); +fifo_make_pipe(&keyb_fifo_get,&keyb_fifo_put); /* Init input system */ pinfo[xp_id].current_module = "init_input"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |