player/command: do seamless angle change when bluray-angle is changed

This commit is contained in:
arch1t3cht
2025-09-07 21:55:50 +02:00
committed by Kacper Michajłow
parent 31bd176357
commit eba7a11a2e
3 changed files with 21 additions and 10 deletions
+6 -1
View File
@@ -154,6 +154,11 @@ struct mp_osd_render_opts {
int osd_shaper;
};
struct mp_bluray_opts {
char *bluray_device;
int angle;
};
typedef struct MPOpts {
bool property_print_help;
bool use_terminal;
@@ -354,7 +359,7 @@ typedef struct MPOpts {
int w32_priority;
bool media_controls;
struct bluray_opts *stream_bluray_opts;
struct mp_bluray_opts *stream_bluray_opts;
struct cdda_opts *stream_cdda_opts;
struct dvb_opts *stream_dvb_opts;
struct lavf_opts *stream_lavf_opts;
+11
View File
@@ -8035,6 +8035,17 @@ void mp_option_run_callback(struct MPContext *mpctx, struct mp_option_callback *
}
}
#if HAVE_LIBBLURAY
if (opt_ptr == &opts->stream_bluray_opts->angle) {
struct demuxer *demuxer = mpctx->demuxer;
if (mpctx->playback_initialized && demuxer && demuxer->stream && strcmp(demuxer->stream->info->name, "bdvm/bluray")) {
int angle = opts->stream_bluray_opts->angle - 1;
stream_control(demuxer->stream, STREAM_CTRL_SET_ANGLE, &angle);
demux_flush(demuxer);
}
}
#endif
if (opt_ptr == &opts->pause)
set_pause_state(mpctx, opts->pause);
+4 -9
View File
@@ -74,20 +74,15 @@
#define AACS_ERROR_NO_DK -8 /* no matching device key */
struct bluray_opts {
char *bluray_device;
int angle;
};
#define OPT_BASE_STRUCT struct bluray_opts
#define OPT_BASE_STRUCT struct mp_bluray_opts
const struct m_sub_options stream_bluray_conf = {
.opts = (const struct m_option[]) {
{"device", OPT_STRING(bluray_device), .flags = M_OPT_FILE},
{"angle", OPT_INT(angle), M_RANGE(1, 999)},
{0},
},
.size = sizeof(struct bluray_opts),
.defaults = &(const struct bluray_opts){
.size = sizeof(struct mp_bluray_opts),
.defaults = &(const struct mp_bluray_opts){
.angle = 1,
},
};
@@ -104,7 +99,7 @@ struct bluray_priv_s {
int cfg_playlist;
char *cfg_device;
struct bluray_opts *opts;
struct mp_bluray_opts *opts;
struct m_config_cache *opts_cache;
};