mirror of
https://github.com/mpv-player/mpv
synced 2025-02-20 23:07:02 +00:00
dec_video: get rid of two global variables
This commit is contained in:
parent
644131fdb4
commit
1dff26730a
@ -448,7 +448,7 @@ const m_option_t common_opts[] = {
|
||||
OPT_STRING("hwdec-codecs", hwdec_codecs, 0),
|
||||
|
||||
// postprocessing:
|
||||
{"pp", &divx_quality, CONF_TYPE_INT, 0, 0, 0, NULL},
|
||||
OPT_INT("pp", divx_quality, 0),
|
||||
#ifdef CONFIG_LIBPOSTPROC
|
||||
{"pphelp", (void *) &pp_help, CONF_TYPE_PRINT, CONF_GLOBAL | CONF_NOCFG, 0, 0, NULL},
|
||||
#endif
|
||||
@ -463,8 +463,8 @@ const m_option_t common_opts[] = {
|
||||
|
||||
// use (probably completely broken) decoder direct rendering
|
||||
OPT_FLAG("dr1", vd_use_dr1, 0),
|
||||
{"field-dominance", &field_dominance, CONF_TYPE_CHOICE, 0,
|
||||
M_CHOICES(({"auto", -1}, {"top", 0}, {"bottom", 1}))},
|
||||
OPT_CHOICE("field-dominance", field_dominance, 0,
|
||||
({"auto", -1}, {"top", 0}, {"bottom", 1})),
|
||||
|
||||
{"lavdopts", (void *) lavc_decode_opts_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
|
||||
.playback_speed = 1.,
|
||||
.movie_aspect = -1.,
|
||||
.field_dominance = -1,
|
||||
.sub_auto = 1,
|
||||
.osd_bar_visible = 1,
|
||||
#ifdef CONFIG_ASS
|
||||
|
@ -165,6 +165,8 @@ typedef struct MPOpts {
|
||||
struct m_obj_settings *vf_settings;
|
||||
float movie_aspect;
|
||||
int flip;
|
||||
int field_dominance;
|
||||
int divx_quality;
|
||||
int vd_use_dr1;
|
||||
char **sub_name;
|
||||
char **sub_paths;
|
||||
|
@ -45,11 +45,6 @@
|
||||
|
||||
#include "video/decode/dec_video.h"
|
||||
|
||||
// ===================================================================
|
||||
|
||||
int field_dominance = -1;
|
||||
|
||||
int divx_quality = 0;
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
if (field_dominance == 0)
|
||||
if (opts->field_dominance == 0)
|
||||
mpi->fields |= MP_IMGFIELD_TOP_FIRST;
|
||||
else if (field_dominance == 1)
|
||||
else if (opts->field_dominance == 1)
|
||||
mpi->fields &= ~MP_IMGFIELD_TOP_FIRST;
|
||||
|
||||
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",
|
||||
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:
|
||||
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[]={
|
||||
IMGFMT_420P,
|
||||
IMGFMT_444P,
|
||||
|
Loading…
Reference in New Issue
Block a user