[Mplayerxp-cvslog] SF.net SVN: mplayerxp:[87] mplayerxp
Brought to you by:
olov
From: <nic...@us...> - 2010-01-08 15:50:02
|
Revision: 87 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=87&view=rev Author: nickols_k Date: 2010-01-08 15:49:56 +0000 (Fri, 08 Jan 2010) Log Message: ----------- disable slice-based draw_callback method on SMP [by default] Modified Paths: -------------- mplayerxp/cfg-mplayer.h mplayerxp/libmpcodecs/vd_ffmpeg.c Modified: mplayerxp/cfg-mplayer.h =================================================================== --- mplayerxp/cfg-mplayer.h 2010-01-08 15:23:59 UTC (rev 86) +++ mplayerxp/cfg-mplayer.h 2010-01-08 15:49:56 UTC (rev 87) @@ -79,6 +79,7 @@ extern int enable_xp; extern int enable_gomp; +extern int enable_ffslices; extern int enable_xp_audio; extern unsigned vo_da_buffs; extern unsigned vo_use_bm; @@ -253,6 +254,8 @@ {"noxp", &enable_xp, CONF_TYPE_FLAG, 0, 1, 0, NULL}, {"gomp", &enable_gomp, CONF_TYPE_FLAG, 0, 0, 1, NULL}, {"nogomp", &enable_gomp, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"ffslices", &enable_ffslices, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"noffslices", &enable_ffslices, CONF_TYPE_FLAG, 0, 1, 0, NULL}, {"da_buffs", &vo_da_buffs, CONF_TYPE_INT, CONF_RANGE, 4, 1024, NULL}, {"enable_bm", &vo_use_bm, CONF_TYPE_FLAG, 0, 0, 1, NULL}, {"enable_bm2", &vo_use_bm, CONF_TYPE_FLAG, 0, 0, 2, NULL}, Modified: mplayerxp/libmpcodecs/vd_ffmpeg.c =================================================================== --- mplayerxp/libmpcodecs/vd_ffmpeg.c 2010-01-08 15:23:59 UTC (rev 86) +++ mplayerxp/libmpcodecs/vd_ffmpeg.c 2010-01-08 15:49:56 UTC (rev 87) @@ -5,6 +5,10 @@ #include <dlfcn.h> /* GLIBC specific. Exists under cygwin too! */ #include "mp_config.h" +#ifdef HAVE_GOMP +#include <omp.h> +#endif + #include "help_mp.h" #include "bswap.h" @@ -61,6 +65,9 @@ #include "libavcodec/avcodec.h" #include "libvo/video_out.h" +int enable_ffslices=-1; +extern int enable_gomp; + extern char *npp_options; static int vcodec_inited=0; typedef struct priv_s @@ -200,7 +207,7 @@ MSG_ERR(MSGTR_MissingLAVCcodec,sh->codec->dll_name); return 0; } - + vdff_ctx->ctx = avcodec_alloc_context(); vdff_ctx->lavc_picture = avcodec_alloc_frame(); if(!(vdff_ctx->ctx && vdff_ctx->lavc_picture)) @@ -208,6 +215,14 @@ MSG_ERR(MSGTR_OutOfMemory); return 0; } +#ifdef HAVE_GOMP + /* Note: Slices have effect on UNI-processor machines only */ + if(enable_ffslices==-1) { + if(omp_get_num_procs()>1 && enable_gomp)enable_ffslices=0; + else enable_ffslices=1; + } +#endif + #ifdef CODEC_FLAG_NOT_TRUNCATED vdff_ctx->ctx->flags|= CODEC_FLAG_NOT_TRUNCATED; #endif @@ -323,7 +338,7 @@ #endif if(sh->bih) vdff_ctx->ctx->bits_per_coded_sample= sh->bih->biBitCount; - if(vdff_ctx->lavc_codec->capabilities&CODEC_CAP_DRAW_HORIZ_BAND) vdff_ctx->cap_slices=1; + if(vdff_ctx->lavc_codec->capabilities&CODEC_CAP_DRAW_HORIZ_BAND && enable_ffslices) vdff_ctx->cap_slices=1; /* enable DR1 method */ if(vdff_ctx->lavc_codec->capabilities&CODEC_CAP_DR1) vdff_ctx->cap_dr1=1; vdff_ctx->ctx->flags|= CODEC_FLAG_EMU_EDGE; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |