Skip to content
Snippets Groups Projects
Commit 19d23dbb authored by Lyndon Brown's avatar Lyndon Brown Committed by Hugo Beauzée-Luyssen
Browse files

vpx: switch mapping of option values to match vpx defines

This fixes the bad option default for this value. The default being
`VPX_DL_GOOD_QUALITY`, which is defined as `1000000` not `0` as seemed to be
the author's assumption, did not map to the specified range of 0-2 and thus
was getting clamped to 2, corresponding to 'best' quality rather than 'good'
quality.

It was requested in review to map the option values to match the vpx defines
rather than simply change the default value to `0`. This necessitates
removal of the range.
parent 40973305
No related branches found
No related tags found
1 merge request!1342vpx: fix bad option default
Pipeline #198715 passed with stage
in 29 minutes and 39 seconds
......@@ -54,7 +54,9 @@ static block_t *Encode(encoder_t *p_enc, picture_t *p_pict);
#define QUALITY_MODE_TEXT N_("Quality mode")
#define QUALITY_MODE_LONGTEXT N_("Quality setting which will determine max encoding time.")
static const int quality_values[] = { 0, 1, 2 };
static const int quality_values[] = {
VPX_DL_GOOD_QUALITY, VPX_DL_REALTIME, VPX_DL_BEST_QUALITY
};
static const char* const quality_desc[] = {
N_("Good"), N_("Realtime"), N_("Best"),
};
......@@ -79,7 +81,6 @@ vlc_module_begin ()
# define ENC_CFG_PREFIX "sout-vpx-"
add_integer( ENC_CFG_PREFIX "quality-mode", VPX_DL_GOOD_QUALITY, QUALITY_MODE_TEXT,
QUALITY_MODE_LONGTEXT )
change_integer_range( 0, 2 )
change_integer_list( quality_values, quality_desc );
#endif
vlc_module_end ()
......@@ -442,10 +443,10 @@ static int OpenEncoder(vlc_object_t *p_this)
/* Deadline (in ms) to spend in encoder */
switch (var_GetInteger(p_enc, ENC_CFG_PREFIX "quality-mode")) {
case 1:
case VPX_DL_REALTIME:
p_sys->quality = VPX_DL_REALTIME;
break;
case 2:
case VPX_DL_BEST_QUALITY:
p_sys->quality = VPX_DL_BEST_QUALITY;
break;
default:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment