Skip to content

Commit 1c679ef

Browse files
guidocellakasper93
andcommitted
various: upgrade option flags to uint64_t
So that they will already work after more UPDATE flags are added. change_flags in m_config_core.h was already uint64_t. Co-authored-by: Kacper Michajłow <[email protected]>
1 parent bba54b5 commit 1c679ef

File tree

7 files changed

+9
-10
lines changed

7 files changed

+9
-10
lines changed

options/m_config_frontend.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ const char *m_config_get_positional_option(const struct m_config *config, int p)
383383
static int handle_set_opt_flags(struct m_config *config,
384384
struct m_config_option *co, int flags)
385385
{
386-
int optflags = co->opt->flags;
386+
uint64_t optflags = co->opt->flags;
387387
bool set = !(flags & M_SETOPT_CHECK_ONLY);
388388

389389
if ((flags & M_SETOPT_PRE_PARSE_ONLY) && !(optflags & M_OPT_PRE_PARSE))

options/m_config_frontend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ typedef struct m_config {
8787
// m_config_notify_change_opt_ptr(). If false, it's caused either by
8888
// m_config_set_option_*() (and similar) calls or external updates.
8989
void (*option_change_callback)(void *ctx, struct m_config_option *co,
90-
int flags, bool self_update);
90+
uint64_t flags, bool self_update);
9191
void *option_change_callback_ctx;
9292

9393
// For the command line parser

options/m_option.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ struct m_sub_options {
215215
const void *defaults;
216216
// Change flags passed to mp_option_change_callback() if any option that is
217217
// directly or indirectly part of this group is changed.
218-
int change_flags;
218+
uint64_t change_flags;
219219
// Return further sub-options, for example for optional components. If set,
220220
// this is called with increasing index (starting from 0), as long as true
221221
// is returned. If true is returned and *sub is set in any of these calls,
@@ -385,7 +385,7 @@ struct m_option {
385385
const m_option_type_t *type;
386386

387387
// See \ref OptionFlags.
388-
unsigned int flags;
388+
uint64_t flags;
389389

390390
// Always force an option update even if the written value does not change.
391391
bool force_update;

player/command.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7598,7 +7598,7 @@ static void update_track_switch(struct MPContext *mpctx, int order, int type)
75987598
mp_wakeup_core(mpctx);
75997599
}
76007600

7601-
void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags,
7601+
void mp_option_change_callback(void *ctx, struct m_config_option *co, uint64_t flags,
76027602
bool self_update)
76037603
{
76047604
struct MPContext *mpctx = ctx;
@@ -7622,8 +7622,7 @@ void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags,
76227622
struct track *track = mpctx->current_track[n][STREAM_SUB];
76237623
struct dec_sub *sub = track ? track->d_sub : NULL;
76247624
if (sub) {
7625-
int ret = sub_control(sub, SD_CTRL_UPDATE_OPTS,
7626-
(void *)(uintptr_t)flags);
7625+
int ret = sub_control(sub, SD_CTRL_UPDATE_OPTS, &flags);
76277626
if (ret == CONTROL_OK && flags & (UPDATE_SUB_FILT | UPDATE_SUB_HARD)) {
76287627
sub_redecode_cached_packets(sub);
76297628
sub_reset(sub);

player/command.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ void property_print_help(struct MPContext *mpctx);
8080
int mp_property_do(const char* name, int action, void* val,
8181
struct MPContext *mpctx);
8282

83-
void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags,
83+
void mp_option_change_callback(void *ctx, struct m_config_option *co, uint64_t flags,
8484
bool self_update);
8585

8686
void mp_notify(struct MPContext *mpctx, int event, void *arg);

sub/dec_sub.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ int sub_control(struct dec_sub *sub, enum sd_ctrl cmd, void *arg)
515515
break;
516516
}
517517
case SD_CTRL_UPDATE_OPTS: {
518-
int flags = (uintptr_t)arg;
518+
uint64_t flags = *(uint64_t *)arg;
519519
if (m_config_cache_update(sub->opts_cache))
520520
update_subtitle_speed(sub);
521521
m_config_cache_update(sub->shared_opts_cache);

sub/sd_ass.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ static int control(struct sd *sd, enum sd_ctrl cmd, void *arg)
10191019
ctx->video_params = *(struct mp_image_params *)arg;
10201020
return CONTROL_OK;
10211021
case SD_CTRL_UPDATE_OPTS: {
1022-
int flags = (uintptr_t)arg;
1022+
uint64_t flags = *(uint64_t *)arg;
10231023
if (flags & UPDATE_SUB_FILT) {
10241024
filters_destroy(sd);
10251025
filters_init(sd);

0 commit comments

Comments
 (0)