1
mirror of https://github.com/mpv-player/mpv synced 2025-03-26 22:42:47 +01:00

dec_video: get rid of two global variables

This commit is contained in:
wm4 2013-05-21 00:45:42 +02:00
parent 644131fdb4
commit 1dff26730a
6 changed files with 9 additions and 13 deletions

@ -448,7 +448,7 @@ const m_option_t common_opts[] = {
OPT_STRING("hwdec-codecs", hwdec_codecs, 0), OPT_STRING("hwdec-codecs", hwdec_codecs, 0),
// postprocessing: // postprocessing:
{"pp", &divx_quality, CONF_TYPE_INT, 0, 0, 0, NULL}, OPT_INT("pp", divx_quality, 0),
#ifdef CONFIG_LIBPOSTPROC #ifdef CONFIG_LIBPOSTPROC
{"pphelp", (void *) &pp_help, CONF_TYPE_PRINT, CONF_GLOBAL | CONF_NOCFG, 0, 0, NULL}, {"pphelp", (void *) &pp_help, CONF_TYPE_PRINT, CONF_GLOBAL | CONF_NOCFG, 0, 0, NULL},
#endif #endif
@ -463,8 +463,8 @@ const m_option_t common_opts[] = {
// use (probably completely broken) decoder direct rendering // use (probably completely broken) decoder direct rendering
OPT_FLAG("dr1", vd_use_dr1, 0), OPT_FLAG("dr1", vd_use_dr1, 0),
{"field-dominance", &field_dominance, CONF_TYPE_CHOICE, 0, OPT_CHOICE("field-dominance", field_dominance, 0,
M_CHOICES(({"auto", -1}, {"top", 0}, {"bottom", 1}))}, ({"auto", -1}, {"top", 0}, {"bottom", 1})),
{"lavdopts", (void *) lavc_decode_opts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, {"lavdopts", (void *) lavc_decode_opts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
{"lavfdopts", (void *) lavfdopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, {"lavfdopts", (void *) lavfdopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},

@ -78,6 +78,7 @@ void set_default_mplayer_options(struct MPOpts *opts)
.audio_output_format = -1, // AF_FORMAT_UNKNOWN .audio_output_format = -1, // AF_FORMAT_UNKNOWN
.playback_speed = 1., .playback_speed = 1.,
.movie_aspect = -1., .movie_aspect = -1.,
.field_dominance = -1,
.sub_auto = 1, .sub_auto = 1,
.osd_bar_visible = 1, .osd_bar_visible = 1,
#ifdef CONFIG_ASS #ifdef CONFIG_ASS

@ -165,6 +165,8 @@ typedef struct MPOpts {
struct m_obj_settings *vf_settings; struct m_obj_settings *vf_settings;
float movie_aspect; float movie_aspect;
int flip; int flip;
int field_dominance;
int divx_quality;
int vd_use_dr1; int vd_use_dr1;
char **sub_name; char **sub_name;
char **sub_paths; char **sub_paths;

@ -45,11 +45,6 @@
#include "video/decode/dec_video.h" #include "video/decode/dec_video.h"
// ===================================================================
int field_dominance = -1;
int divx_quality = 0;
int get_video_quality_max(sh_video_t *sh_video) int get_video_quality_max(sh_video_t *sh_video)
{ {
@ -318,9 +313,9 @@ void *decode_video(sh_video_t *sh_video, struct demux_packet *packet,
return NULL; // error / skipped frame return NULL; // error / skipped frame
} }
if (field_dominance == 0) if (opts->field_dominance == 0)
mpi->fields |= MP_IMGFIELD_TOP_FIRST; mpi->fields |= MP_IMGFIELD_TOP_FIRST;
else if (field_dominance == 1) else if (opts->field_dominance == 1)
mpi->fields &= ~MP_IMGFIELD_TOP_FIRST; mpi->fields &= ~MP_IMGFIELD_TOP_FIRST;
double prevpts = sh_video->codec_reordered_pts; double prevpts = sh_video->codec_reordered_pts;

@ -72,7 +72,7 @@ int mpcodecs_config_vo(sh_video_t *sh, int w, int h, unsigned int out_fmt)
mp_msg(MSGT_DECVIDEO, MSGL_V, "VDec: vo config request - %d x %d (%s)\n", mp_msg(MSGT_DECVIDEO, MSGL_V, "VDec: vo config request - %d x %d (%s)\n",
w, h, vo_format_name(out_fmt)); w, h, vo_format_name(out_fmt));
if (get_video_quality_max(sh) <= 0 && divx_quality) { if (get_video_quality_max(sh) <= 0 && opts->divx_quality) {
// user wants postprocess but no pp filter yet: // user wants postprocess but no pp filter yet:
sh->vfilter = vf = vf_open_filter(opts, vf, "pp", NULL); sh->vfilter = vf = vf_open_filter(opts, vf, "pp", NULL);
} }

@ -131,8 +131,6 @@ static struct mp_image *filter(struct vf_instance *vf, struct mp_image *mpi)
//===========================================================================// //===========================================================================//
extern int divx_quality;
static const unsigned int fmt_list[]={ static const unsigned int fmt_list[]={
IMGFMT_420P, IMGFMT_420P,
IMGFMT_444P, IMGFMT_444P,