Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76d771a6fa | ||
|
|
19caba0794 | ||
|
|
391546c52f | ||
|
|
a8af6a7852 | ||
|
|
960aca3386 | ||
|
|
e72a327d74 | ||
|
|
87f955f3e9 | ||
|
|
5536ebe82f | ||
|
|
ef8b37ca2a | ||
|
|
d4a5513847 | ||
|
|
d42212cd67 | ||
|
|
674cc1d3a9 | ||
|
|
c47bb9ca42 | ||
|
|
938dad0b88 | ||
|
|
82b5361946 | ||
|
|
f99f48684b | ||
|
|
25864a5539 | ||
|
|
524d9585fd | ||
|
|
95a72baf92 | ||
|
|
48112a74ed | ||
|
|
8427cdc717 | ||
|
|
b695ca1e27 | ||
|
|
801feb6420 | ||
|
|
de6a452039 | ||
|
|
4b764b6cc6 | ||
|
|
7b7c31b190 | ||
|
|
70a66b461d |
No files matched your search
@@ -103,6 +103,13 @@ OPTIONS
|
||||
Override movie aspect ratio, in case aspect information is incorrect or
|
||||
missing in the file being played. See also ``--no-aspect``.
|
||||
|
||||
Two values have special meaning:
|
||||
|
||||
:0: disable aspect ratio handling, pretend the video has square pixels
|
||||
:-1: use the video stream or container aspect (default)
|
||||
|
||||
But note that handling of these special values might change in the future.
|
||||
|
||||
.. admonition:: Examples
|
||||
|
||||
- ``--aspect=4:3`` or ``--aspect=1.3333``
|
||||
|
||||
+15
-13
@@ -3,20 +3,18 @@
|
||||
"""
|
||||
This script emulates "unique application" functionality on Linux. When starting
|
||||
playback with this script, it will try to reuse an already running instance of
|
||||
mpv (but only if that was started with umpv).
|
||||
mpv (but only if that was started with umpv). Other mpv instances (not started
|
||||
by umpv) are ignored, and the script doesn't know about them.
|
||||
|
||||
This script only uses mpv instances started with umpv. Other instances are
|
||||
ignored, and don't exist for the script.
|
||||
|
||||
This only takes filenames as arguments. If mpv is already running, they are
|
||||
appended to mpv's internal playlist. If the file does not exist or is otherwise
|
||||
not playable, mpv will skip the playlist entry when attempting to play it (from
|
||||
the GUI perspective, it's silently ignored).
|
||||
This only takes filenames as arguments. Custom options can't be used; the script
|
||||
interprets them as filenames. If mpv is already running, the files passed to
|
||||
umpv are appended to mpv's internal playlist. If a file does not exist or is
|
||||
otherwise not playable, mpv will skip the playlist entry when attempting to
|
||||
play it (from the GUI perspective, it's silently ignored).
|
||||
|
||||
If mpv isn't running yet, this script will start mpv and let it control the
|
||||
current terminal. If you play an audio-only file, mpv will not open a window
|
||||
(that is its normal behavior; but it might not be what a user expects if this
|
||||
script is used in a GUI setting).
|
||||
current terminal. It will not write output to stdout/stderr, because this
|
||||
will typically just fill ~/.xsession-errors with garbage.
|
||||
|
||||
mpv will terminate if there are no more files to play, and running the umpv
|
||||
script after that will start a new mpv instance.
|
||||
@@ -28,7 +26,10 @@ Note that you can control the mpv instance by writing to the command fifo:
|
||||
Warning:
|
||||
|
||||
The script attempts to make sure the FIFO is safely created (i.e. not world-
|
||||
readable, not trying to open a bogus
|
||||
writable), and checks that it's really a FIFO. This is important for security,
|
||||
because the FIFO allows anyone with write access to run arbitrary commands
|
||||
in mpv's context using the "run" input command. If you are worried about
|
||||
security, you should verify that the code handles these concerns correctly.
|
||||
"""
|
||||
|
||||
import sys
|
||||
@@ -88,4 +89,5 @@ else:
|
||||
raise e
|
||||
os.mkfifo(FIFO, 0600)
|
||||
|
||||
subprocess.check_call(["mpv", "--input-file=" + FIFO] + files)
|
||||
subprocess.check_call(["mpv", "--really-quiet", "--force-window",
|
||||
"--input-file=" + FIFO, "--"] + files)
|
||||
+1
-1
@@ -112,7 +112,7 @@ enum af_format {
|
||||
// Planar variants
|
||||
AF_FORMAT_U8P = (AF_INTP|AF_FORMAT_US|AF_FORMAT_8BIT|AF_FORMAT_NE),
|
||||
AF_FORMAT_S16P = (AF_INTP|AF_FORMAT_SI|AF_FORMAT_16BIT|AF_FORMAT_NE),
|
||||
AF_FORMAT_S32P = (AF_INTP|AF_FORMAT_US|AF_FORMAT_32BIT|AF_FORMAT_NE),
|
||||
AF_FORMAT_S32P = (AF_INTP|AF_FORMAT_SI|AF_FORMAT_32BIT|AF_FORMAT_NE),
|
||||
AF_FORMAT_FLOATP = (AF_FLTP|AF_FORMAT_32BIT|AF_FORMAT_NE),
|
||||
AF_FORMAT_DOUBLEP = (AF_FLTP|AF_FORMAT_64BIT|AF_FORMAT_NE),
|
||||
|
||||
|
||||
+2
-2
@@ -226,7 +226,7 @@ struct demux_packet *demux_copy_packet(struct demux_packet *dp)
|
||||
struct sh_stream *new_sh_stream(demuxer_t *demuxer, enum stream_type type)
|
||||
{
|
||||
if (demuxer->num_streams > MAX_SH_STREAMS) {
|
||||
MP_WARN(demuxer, "Too many streams.");
|
||||
MP_WARN(demuxer, "Too many streams.\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -373,7 +373,7 @@ static bool demux_check_queue_full(demuxer_t *demux)
|
||||
overflow:
|
||||
|
||||
if (!demux->warned_queue_overflow) {
|
||||
MP_ERR(demux, "\nToo many packets in the demuxer "
|
||||
MP_ERR(demux, "Too many packets in the demuxer "
|
||||
"packet queue (video: %d packets in %d bytes, audio: %d "
|
||||
"packets in %d bytes, sub: %d packets in %d bytes).\n",
|
||||
count_packs(demux, STREAM_VIDEO), count_bytes(demux, STREAM_VIDEO),
|
||||
|
||||
+3
-3
@@ -64,11 +64,11 @@ mf_t *open_mf_pattern(void *talloc_ctx, struct mp_log *log, char *filename)
|
||||
if (filename[0] == '@') {
|
||||
FILE *lst_f = fopen(filename + 1, "r");
|
||||
if (lst_f) {
|
||||
char *fname = talloc_size(mf, MP_PATH_MAX);
|
||||
while (fgets(fname, MP_PATH_MAX, lst_f)) {
|
||||
char *fname = talloc_size(mf, 512);
|
||||
while (fgets(fname, 512, lst_f)) {
|
||||
/* remove spaces from end of fname */
|
||||
char *t = fname + strlen(fname) - 1;
|
||||
while (t > fname && isspace(*t))
|
||||
while (t > fname && isspace((unsigned char)*t))
|
||||
*(t--) = 0;
|
||||
if (!mp_path_exists(fname)) {
|
||||
mp_verbose(log, "file not found: '%s'\n", fname);
|
||||
|
||||
+2
-2
@@ -1169,10 +1169,10 @@ fi
|
||||
|
||||
if test "$cc_vendor" = "gnu" ; then
|
||||
cflag_check -Wundef && WARNFLAGS="-Wundef $WARNFLAGS"
|
||||
# -std=gnu99 is not a warning flag but is placed in WARN_CFLAGS because
|
||||
# -std=c99 is not a warning flag but is placed in WARN_CFLAGS because
|
||||
# that's the only variable specific to C now, and this option is not valid
|
||||
# for C++.
|
||||
cflag_check -std=gnu99 && WARN_CFLAGS="-std=gnu99 $WARN_CFLAGS"
|
||||
cflag_check -std=c99 && WARN_CFLAGS="-std=c99 $WARN_CFLAGS"
|
||||
cflag_check -Wno-pointer-sign && WARN_CFLAGS="-Wno-pointer-sign $WARN_CFLAGS"
|
||||
cflag_check -Wdisabled-optimization && WARN_CFLAGS="-Wdisabled-optimization $WARN_CFLAGS"
|
||||
cflag_check -Wmissing-prototypes && WARN_CFLAGS="-Wmissing-prototypes $WARN_CFLAGS"
|
||||
|
||||
@@ -334,11 +334,13 @@ static int audio_start_sync(struct MPContext *mpctx, int playsize)
|
||||
res = audio_decode(d_audio, ao->buffer, a);
|
||||
if (skip_samples <= mp_audio_buffer_samples(ao->buffer)) {
|
||||
mp_audio_buffer_skip(ao->buffer, skip_samples);
|
||||
ao->buffer_playable_samples = 0;
|
||||
if (res < 0)
|
||||
return res;
|
||||
return audio_decode(d_audio, ao->buffer, playsize);
|
||||
}
|
||||
mp_audio_buffer_clear(ao->buffer);
|
||||
ao->buffer_playable_samples = 0;
|
||||
if (res < 0)
|
||||
return res;
|
||||
}
|
||||
@@ -442,6 +444,7 @@ int fill_audio_out_buffers(struct MPContext *mpctx, double endpts)
|
||||
mp_audio_buffer_peek(ao->buffer, &data);
|
||||
data.samples = MPMIN(data.samples, playsize);
|
||||
int played = write_to_ao(mpctx, &data, playflags, written_audio_pts(mpctx));
|
||||
assert(played >= 0 && played <= data.samples);
|
||||
ao->buffer_playable_samples = playsize - played;
|
||||
|
||||
if (played > 0) {
|
||||
|
||||
+2
-2
@@ -700,8 +700,8 @@ static int tag_property(m_option_t *prop, int action, void *arg,
|
||||
char **slist = NULL;
|
||||
int num = 0;
|
||||
for (int n = 0; n < tags->num_keys; n++) {
|
||||
MP_TARRAY_APPEND(NULL, slist, num, tags->keys[n]);
|
||||
MP_TARRAY_APPEND(NULL, slist, num, tags->values[n]);
|
||||
MP_TARRAY_APPEND(NULL, slist, num, talloc_strdup(NULL, tags->keys[n]));
|
||||
MP_TARRAY_APPEND(NULL, slist, num, talloc_strdup(NULL, tags->values[n]));
|
||||
}
|
||||
MP_TARRAY_APPEND(NULL, slist, num, NULL);
|
||||
*(char ***)arg = slist;
|
||||
|
||||
@@ -672,6 +672,8 @@ void mp_switch_track_n(struct MPContext *mpctx, int order, enum stream_type type
|
||||
}
|
||||
}
|
||||
|
||||
osd_changed_all(mpctx->osd);
|
||||
|
||||
talloc_free(mpctx->track_layout_hash);
|
||||
mpctx->track_layout_hash = talloc_steal(mpctx, track_layout_hash(mpctx));
|
||||
}
|
||||
|
||||
+18
-4
@@ -75,6 +75,7 @@ struct priv {
|
||||
int64_t fill_limit; // we should fill buffer only if space>=fill_limit
|
||||
int64_t seek_limit; // keep filling cache if distance is less that seek limit
|
||||
struct byte_meta *bm; // additional per-byte metadata
|
||||
bool seekable; // underlying stream is seekable
|
||||
|
||||
struct mp_log *log;
|
||||
|
||||
@@ -475,6 +476,7 @@ static int cache_seek(stream_t *cache, int64_t pos)
|
||||
{
|
||||
struct priv *s = cache->priv;
|
||||
assert(s->cache_thread_running);
|
||||
int r = 1;
|
||||
|
||||
pthread_mutex_lock(&s->mutex);
|
||||
|
||||
@@ -482,12 +484,21 @@ static int cache_seek(stream_t *cache, int64_t pos)
|
||||
" (cur=%" PRId64 ") <= %" PRId64 " \n",
|
||||
s->min_filepos, pos, s->read_filepos, s->max_filepos);
|
||||
|
||||
cache->pos = s->read_filepos = pos;
|
||||
s->eof = false; // so that cache_read() will actually wait for new data
|
||||
pthread_cond_signal(&s->wakeup);
|
||||
if (!s->seekable && pos > s->max_filepos) {
|
||||
MP_ERR(s, "Attempting to seek past cached data in unseekable stream.\n");
|
||||
r = 0;
|
||||
} else if (!s->seekable && pos < s->min_filepos) {
|
||||
MP_ERR(s, "Attempting to seek before cached data in unseekable stream.\n");
|
||||
r = 0;
|
||||
} else {
|
||||
cache->pos = s->read_filepos = pos;
|
||||
s->eof = false; // so that cache_read() will actually wait for new data
|
||||
pthread_cond_signal(&s->wakeup);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&s->mutex);
|
||||
|
||||
return 1;
|
||||
return r;
|
||||
}
|
||||
|
||||
static int cache_control(stream_t *cache, int cmd, void *arg)
|
||||
@@ -600,6 +611,9 @@ int stream_cache_init(stream_t *cache, stream_t *stream, int64_t size,
|
||||
if (min > s->buffer_size - s->fill_limit)
|
||||
min = s->buffer_size - s->fill_limit;
|
||||
|
||||
s->seekable = (stream->flags & MP_STREAM_SEEK) == MP_STREAM_SEEK &&
|
||||
stream->end_pos > 0;
|
||||
|
||||
if (pthread_create(&s->cache_thread, NULL, cache_thread, s) != 0) {
|
||||
MP_ERR(s, "Starting cache process/thread failed: %s.\n",
|
||||
strerror(errno));
|
||||
|
||||
@@ -399,10 +399,10 @@ int video_reconfig_filters(struct dec_video *d_video,
|
||||
}
|
||||
|
||||
float force_aspect = opts->movie_aspect;
|
||||
if (force_aspect > -1.0 && d_video->stream_aspect != 0.0)
|
||||
if (force_aspect > 0.0 && d_video->stream_aspect != 0.0)
|
||||
force_aspect = d_video->stream_aspect;
|
||||
|
||||
if (force_aspect > 0)
|
||||
if (force_aspect >= 0.0)
|
||||
vf_set_dar(&p.d_w, &p.d_h, p.w, p.h, force_aspect);
|
||||
|
||||
if (abs(p.d_w - p.w) >= 4 || abs(p.d_h - p.h) >= 4) {
|
||||
|
||||
+9
-3
@@ -157,14 +157,20 @@ struct lut3d *mp_load_icc(struct mp_icc_opts *opts, struct mp_log *log,
|
||||
if (!profile)
|
||||
goto error_exit;
|
||||
|
||||
cmsCIExyY d65;
|
||||
cmsWhitePointFromTemp(&d65, 6504);
|
||||
cmsCIExyY d65 = {0.3127, 0.3290, 1.0};
|
||||
static const cmsCIExyYTRIPLE bt709prim = {
|
||||
.Red = {0.64, 0.33, 1.0},
|
||||
.Green = {0.30, 0.60, 1.0},
|
||||
.Blue = {0.15, 0.06, 1.0},
|
||||
};
|
||||
cmsToneCurve *tonecurve = cmsBuildGamma(NULL, 1.0/0.45);
|
||||
|
||||
/* Rec BT.709 defines the tone curve as:
|
||||
V = 1.099 * L^0.45 - 0.099 for L >= 0.018
|
||||
V = 4.500 * L for L < 0.018
|
||||
|
||||
The 0.081 parameter comes from inserting 0.018 into the function */
|
||||
cmsToneCurve *tonecurve = cmsBuildParametricToneCurve(NULL, 4,
|
||||
(cmsFloat64Number[5]){1/0.45, 1/1.099, 0.099/1.099, 1/4.5, 0.081});
|
||||
cmsHPROFILE vid_profile = cmsCreateRGBProfile(&d65, &bt709prim,
|
||||
(cmsToneCurve*[3]){tonecurve, tonecurve, tonecurve});
|
||||
cmsFreeToneCurve(tonecurve);
|
||||
|
||||
@@ -45,8 +45,14 @@
|
||||
#if __VERSION__ >= 130
|
||||
vec3 srgb_compand(vec3 v)
|
||||
{
|
||||
return mix(1.055 * pow(v, vec3(1.0/2.4)) - vec3(0.055), v * 12.92,
|
||||
lessThanEqual(v, vec3(0.0031308)));
|
||||
return mix(v * 12.92, 1.055 * pow(v, vec3(1.0/2.4)) - vec3(0.055),
|
||||
lessThanEqual(vec3(0.0031308), v));
|
||||
}
|
||||
|
||||
vec3 bt709_expand(vec3 v)
|
||||
{
|
||||
return mix(v / 4.5, pow((v + vec3(0.099))/1.099, vec3(1/0.45)),
|
||||
lessThanEqual(vec3(0.0812), v));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -384,6 +390,13 @@ void main() {
|
||||
color = texture3D(lut_3d, color).rgb;
|
||||
#endif
|
||||
#ifdef USE_SRGB
|
||||
// Go from "linear" (0.45) to BT.709 to true linear to sRGB
|
||||
#ifndef USE_3DLUT
|
||||
// Unless we are using a 3DLUT, in which case USE_LINEAR_CONV_INV
|
||||
// already triggered earlier.
|
||||
color = pow(color, vec3(0.45));
|
||||
#endif
|
||||
color = bt709_expand(color.rgb);
|
||||
color.rgb = srgb_compand(color.rgb);
|
||||
#endif
|
||||
#ifdef USE_DITHER
|
||||
|
||||
+11
-4
@@ -44,6 +44,11 @@ static bool create_context_x11_old(struct MPGLContext *ctx)
|
||||
if (glx_ctx->context)
|
||||
return true;
|
||||
|
||||
if (!glx_ctx->vinfo) {
|
||||
MP_FATAL(vo, "Can't create a legacy GLX context without X visual\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
GLXContext new_context = glXCreateContext(display, glx_ctx->vinfo, NULL,
|
||||
True);
|
||||
if (!new_context) {
|
||||
@@ -219,6 +224,7 @@ static bool config_window_x11(struct MPGLContext *ctx, uint32_t d_width,
|
||||
int glx_attribs[] = {
|
||||
GLX_STEREO, False,
|
||||
GLX_X_RENDERABLE, True,
|
||||
GLX_X_VISUAL_TYPE, GLX_TRUE_COLOR,
|
||||
GLX_RED_SIZE, 1,
|
||||
GLX_GREEN_SIZE, 1,
|
||||
GLX_BLUE_SIZE, 1,
|
||||
@@ -254,12 +260,13 @@ static bool config_window_x11(struct MPGLContext *ctx, uint32_t d_width,
|
||||
|
||||
glx_ctx->fbc = fbc;
|
||||
glx_ctx->vinfo = glXGetVisualFromFBConfig(vo->x11->display, fbc);
|
||||
if (!glx_ctx->vinfo) {
|
||||
MP_ERR(vo, "Selected GLX FB config has no associated X visual\n");
|
||||
return false;
|
||||
if (glx_ctx->vinfo) {
|
||||
MP_VERBOSE(vo, "GLX chose visual with ID 0x%x\n",
|
||||
(int)glx_ctx->vinfo->visualid);
|
||||
} else {
|
||||
MP_WARN(vo, "Selected GLX FB config has no associated X visual\n");
|
||||
}
|
||||
|
||||
MP_VERBOSE(vo, "GLX chose visual with ID 0x%x\n", (int)glx_ctx->vinfo->visualid);
|
||||
|
||||
glXGetFBConfigAttrib(vo->x11->display, fbc, GLX_RED_SIZE, &ctx->depth_r);
|
||||
glXGetFBConfigAttrib(vo->x11->display, fbc, GLX_GREEN_SIZE, &ctx->depth_g);
|
||||
|
||||
@@ -176,6 +176,9 @@ static int change_vdptime_sync(struct vo *vo, int64_t *t)
|
||||
vdp_time -= (t2 - t1) * 1000ULL;
|
||||
else
|
||||
vdp_time = old;
|
||||
} else if (!vdp_time) {
|
||||
/* Some drivers do not return timestamps. */
|
||||
vdp_time = old;
|
||||
}
|
||||
MP_DBG(vo, "adjusting VdpTime offset by %f µs\n",
|
||||
(int64_t)(vdp_time - old) / 1000.);
|
||||
@@ -1064,6 +1067,10 @@ static void flip_page_timed(struct vo *vo, int64_t pts_us, int duration)
|
||||
if (vc->vsync_interval == 1)
|
||||
duration = -1; // Make sure drop logic is disabled
|
||||
|
||||
/* If the presentation time may not be before our last timestamp sync. */
|
||||
if (pts_us && pts_us < vc->last_sync_update)
|
||||
pts_us = vc->last_sync_update;
|
||||
|
||||
uint64_t now = sync_vdptime(vo);
|
||||
uint64_t pts = pts_us ? convert_to_vdptime(vo, pts_us) : now;
|
||||
uint64_t ideal_pts = pts;
|
||||
|
||||
@@ -41,13 +41,6 @@
|
||||
|
||||
#define MAX_BUFFERS 2
|
||||
|
||||
// minium target version for the new formats (1.2.90)
|
||||
#define MINIMUM_VERSION (1 << 16 | 2 << 8 | 90)
|
||||
|
||||
#define CURRENT_VERSION (WAYLAND_VERSION_MAJOR << 16 | \
|
||||
WAYLAND_VERSION_MINOR << 8 | \
|
||||
WAYLAND_VERSION_MICRO)
|
||||
|
||||
static void draw_image(struct vo *vo, mp_image_t *mpi);
|
||||
|
||||
static const struct wl_callback_listener frame_listener;
|
||||
@@ -65,7 +58,6 @@ struct fmtentry {
|
||||
static const struct fmtentry fmttable[] = {
|
||||
{WL_SHM_FORMAT_ARGB8888, IMGFMT_BGRA}, // 8b 8g 8r 8a
|
||||
{WL_SHM_FORMAT_XRGB8888, IMGFMT_BGR0},
|
||||
#if CURRENT_VERSION >= MINIMUM_VERSION
|
||||
{WL_SHM_FORMAT_RGB332, IMGFMT_BGR8}, // 3b 3g 2r
|
||||
{WL_SHM_FORMAT_BGR233, IMGFMT_RGB8}, // 3r 3g 3b,
|
||||
{WL_SHM_FORMAT_XRGB4444, IMGFMT_BGR12_LE}, // 4b 4g 4r 4a
|
||||
@@ -94,7 +86,6 @@ static const struct fmtentry fmttable[] = {
|
||||
{WL_SHM_FORMAT_ABGR8888, IMGFMT_RGBA},
|
||||
{WL_SHM_FORMAT_RGBA8888, IMGFMT_ABGR},
|
||||
{WL_SHM_FORMAT_BGRA8888, IMGFMT_ARGB},
|
||||
#endif
|
||||
};
|
||||
|
||||
#define MAX_FORMAT_ENTRIES (sizeof(fmttable) / sizeof(fmttable[0]))
|
||||
@@ -496,6 +487,8 @@ static void frame_handle_redraw(void *data,
|
||||
if (p->resize_attach) {
|
||||
destroy_shm_buffer(&p->tmp_buffer);
|
||||
p->resize_attach = false;
|
||||
p->x = 0;
|
||||
p->y = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
+11
-9
@@ -757,7 +757,6 @@ int vo_x11_check_events(struct vo *vo)
|
||||
vo_x11_update_geometry(vo);
|
||||
while (XPending(display)) {
|
||||
XNextEvent(display, &Event);
|
||||
// printf("\rEvent.type=%X \n",Event.type);
|
||||
switch (Event.type) {
|
||||
case Expose:
|
||||
x11->pending_vo_events |= VO_EVENT_EXPOSE;
|
||||
@@ -818,14 +817,9 @@ int vo_x11_check_events(struct vo *vo)
|
||||
(MP_MOUSE_BTN0 + Event.xbutton.button - 1) |
|
||||
get_mods(Event.xbutton.state) | MP_KEY_STATE_UP);
|
||||
break;
|
||||
case PropertyNotify: {
|
||||
char *name = XGetAtomName(display, Event.xproperty.atom);
|
||||
if (!name)
|
||||
break;
|
||||
XFree(name);
|
||||
break;
|
||||
}
|
||||
case MapNotify:
|
||||
x11->window_hidden = false;
|
||||
vo_x11_update_geometry(vo);
|
||||
x11->vo_hint.win_gravity = x11->old_gravity;
|
||||
XSetWMNormalHints(display, x11->window, &x11->vo_hint);
|
||||
x11->fs_flip = 0;
|
||||
@@ -1135,7 +1129,6 @@ static void vo_x11_map_window(struct vo *vo, int x, int y, int w, int h)
|
||||
{
|
||||
struct vo_x11_state *x11 = vo->x11;
|
||||
|
||||
x11->window_hidden = false;
|
||||
vo_x11_move_resize(vo, true, true, x, y, w, h);
|
||||
if (!vo->opts->border)
|
||||
vo_x11_decoration(vo, 0);
|
||||
@@ -1230,6 +1223,13 @@ void vo_x11_config_vo_window(struct vo *vo, XVisualInfo *vis, int x, int y,
|
||||
XSync(x11->display, False);
|
||||
|
||||
vo_x11_update_geometry(vo);
|
||||
if (x11->window_hidden) {
|
||||
// The real size is only known when the window is mapped, which
|
||||
// unfortunately happens asynchronous to VO initialization. At least
|
||||
// vdpau needs a _some_ window size, though.
|
||||
x11->win_width = width;
|
||||
x11->win_height = height;
|
||||
}
|
||||
update_vo_size(vo);
|
||||
x11->pending_vo_events &= ~VO_EVENT_RESIZE; // implicitly done by the VO
|
||||
}
|
||||
@@ -1342,6 +1342,8 @@ static void vo_x11_update_geometry(struct vo *vo)
|
||||
int dummy_int;
|
||||
Window dummy_win;
|
||||
Window win = vo->opts->WinID > 0 ? vo->opts->WinID : x11->window;
|
||||
if (x11->window_hidden)
|
||||
return;
|
||||
XGetGeometry(x11->display, win, &dummy_win, &dummy_int, &dummy_int,
|
||||
&w, &h, &dummy_int, &dummy_uint);
|
||||
if (w <= INT_MAX && h <= INT_MAX) {
|
||||
|
||||
@@ -15,7 +15,7 @@ def __add_generic_flags__(ctx):
|
||||
ctx.env.CFLAGS += ["-D_ISOC99_SOURCE", "-D_GNU_SOURCE",
|
||||
"-D_LARGEFILE_SOURCE", "-D_FILE_OFFSET_BITS=64",
|
||||
"-D_LARGEFILE64_SOURCE",
|
||||
"-std=gnu99", "-Wall"]
|
||||
"-std=c99", "-Wall"]
|
||||
|
||||
if ctx.is_debug_build():
|
||||
ctx.env.CFLAGS += ['-g']
|
||||
|
||||
@@ -507,8 +507,8 @@ video_output_features = [
|
||||
} , {
|
||||
'name': '--wayland',
|
||||
'desc': 'Wayland',
|
||||
'func': check_pkg_config('wayland-client', '>= 1.2.0',
|
||||
'wayland-cursor', '>= 1.2.0',
|
||||
'func': check_pkg_config('wayland-client', '>= 1.3.0',
|
||||
'wayland-cursor', '>= 1.3.0',
|
||||
'xkbcommon', '>= 0.3.0'),
|
||||
} , {
|
||||
'name': '--x11',
|
||||
|
||||
Reference in new issue
Block a user