From 7dc42263486bd45d2ba830f065a8556c02aaf7c8 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Thu, 24 Apr 2008 08:20:59 +0300 Subject: Move vd_use_slices to options struct --- cfg-common-opts.h | 4 ++-- defaultopts.c | 1 + libmpcodecs/vd.c | 3 --- libmpcodecs/vd.h | 2 -- libmpcodecs/vd_ffmpeg.c | 2 +- libmpcodecs/vd_libmpeg2.c | 4 ++-- options.h | 1 + 7 files changed, 7 insertions(+), 10 deletions(-) diff --git a/cfg-common-opts.h b/cfg-common-opts.h index e4dd1edc12..6401bf566b 100644 --- a/cfg-common-opts.h +++ b/cfg-common-opts.h @@ -242,8 +242,8 @@ {"tskeepbroken", &ts_keep_broken, CONF_TYPE_FLAG, 0, 0, 1, NULL}, // draw by slices or whole frame (useful with libmpeg2/libavcodec) - {"slices", &vd_use_slices, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"noslices", &vd_use_slices, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + OPT_FLAG_ON("slices", vd_use_slices, 0), + OPT_FLAG_OFF("noslices", vd_use_slices, 0), {"field-dominance", &field_dominance, CONF_TYPE_INT, CONF_RANGE, -1, 1, NULL}, #ifdef USE_LIBAVCODEC diff --git a/defaultopts.c b/defaultopts.c index ace5395010..24ee0dcb84 100644 --- a/defaultopts.c +++ b/defaultopts.c @@ -16,6 +16,7 @@ void set_default_mplayer_options(struct MPOpts *opts) .playback_speed = 1., .movie_aspect = -1., .flip = -1, + .vd_use_slices = 1, .lavc_param = (struct lavc_param){ .workaround_bugs = 1, // autodetect .error_resilience = 2, diff --git a/libmpcodecs/vd.c b/libmpcodecs/vd.c index 623be9b2e8..f5d55be271 100644 --- a/libmpcodecs/vd.c +++ b/libmpcodecs/vd.c @@ -103,9 +103,6 @@ vd_functions_t *mpcodecs_vd_drivers[] = { #include "libvo/video_out.h" -// libvo opts: -int vd_use_slices = 1; - /** global variables for gamma, brightness, contrast, saturation and hue modified by mplayer.c and gui/mplayer/gtk/eq.c: ranges -100 - 100 diff --git a/libmpcodecs/vd.h b/libmpcodecs/vd.h index 1b6a5ba208..03f1453539 100644 --- a/libmpcodecs/vd.h +++ b/libmpcodecs/vd.h @@ -20,8 +20,6 @@ typedef struct vd_functions // NULL terminated array of all drivers extern vd_functions_t* mpcodecs_vd_drivers[]; -extern int vd_use_slices; - #define VDCTRL_QUERY_FORMAT 3 /* test for availabilty of a format */ #define VDCTRL_QUERY_MAX_PP_LEVEL 4 /* test for postprocessing support (max level) */ #define VDCTRL_SET_PP_LEVEL 5 /* set postprocessing level */ diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index 4ecf2c0dc9..87d0fd20b2 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -226,7 +226,7 @@ static int init(sh_video_t *sh){ return 0; } - if(vd_use_slices && (lavc_codec->capabilities&CODEC_CAP_DRAW_HORIZ_BAND) && !do_vis_debug) + if(sh->opts->vd_use_slices && (lavc_codec->capabilities&CODEC_CAP_DRAW_HORIZ_BAND) && !do_vis_debug) ctx->do_slices=1; if(lavc_codec->capabilities&CODEC_CAP_DR1 && !do_vis_debug && lavc_codec->id != CODEC_ID_H264 && lavc_codec->id != CODEC_ID_INTERPLAY_VIDEO && lavc_codec->id != CODEC_ID_ROQ) diff --git a/libmpcodecs/vd_libmpeg2.c b/libmpcodecs/vd_libmpeg2.c index c8ca0e92b6..369c1da685 100644 --- a/libmpcodecs/vd_libmpeg2.c +++ b/libmpcodecs/vd_libmpeg2.c @@ -2,7 +2,7 @@ #include #include "config.h" - +#include "options.h" #include "mp_msg.h" #include "vd_internal.h" @@ -214,7 +214,7 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ } mpeg2_skip(mpeg2dec, 0); //mpeg2skip skips frames until set again to 0 - use_callback = (!framedrop && vd_use_slices && + use_callback = (!framedrop && sh->opts->vd_use_slices && (info->current_picture->flags&PIC_FLAG_PROGRESSIVE_FRAME)) ? MP_IMGFLAG_DRAW_CALLBACK:0; diff --git a/options.h b/options.h index 4e3b6e0056..324108252c 100644 --- a/options.h +++ b/options.h @@ -24,6 +24,7 @@ typedef struct MPOpts { float movie_aspect; float screen_size_xy; int flip; + int vd_use_slices; struct lavc_param { int workaround_bugs; int error_resilience; -- cgit v1.2.3