Compare commits

..
28 Commits
Author SHA1 Message Date
wm4 756d45e414 Release 0.1.7 2013-09-20 21:33:32 +02:00
wm4 1cfa0a69ac manpage: af_volnorm was renamed 2013-09-20 21:33:32 +02:00
wm4 dea583410c vf: fix filter initialization error check
vf_open returns 0 on error, 1 on success. Oops. Accidentally broken
with 6629a95.
2013-09-20 21:33:32 +02:00
Johan Kiviniemi 568ab3672a ao_pulse: bug fix: goto the correct error handler
Conflicts:
	audio/out/ao_pulse.c
2013-09-20 21:33:32 +02:00
Johan Kiviniemi 0dd66b8b2c ao_pulse: set the property media.role=video
Adjusted for the stable branch.

Signed-off-by: wm4 <wm4@nowhere>
2013-09-20 21:33:32 +02:00
Martin Herkt 31a5fe6fa8 x11_common: fix behavior if XCreateIC() fails
This consists of 3 commits squashed and cherry-picked from master
(there were some minor conflicts):

vo/x11_common: Fail init with no valid XIM

XOpenIM can fail to find a valid input method, in which case it
returns NULL. Passing a NULL pointer to XCreateIC would cause a
crash, so fail VO init before that happens.

vo/x11_common: remove superfluous msg prefixes

Conflicts:
	video/out/x11_common.c

vo/x11_common: don't require a working input method

Normally, we need this for Xutf8LookupString(). But we can just fall
back to XLookupString(). In fact, the code for this was already there,
the code was just never tested and was actually crashing when active
(see commit 2115c4a).
2013-09-20 21:33:32 +02:00
Alexander Preisinger 36fe16cc7e wayland/common: exit properly on fd errors
Before this commit there was just an error message, but the file descriptor was
still open. Now we close the file descriptor and prevent it from calling
endlessly. Also a CLOSE_WIN event is sent which closes the window eventually if
the action of CLOSE_WIN is set to quit or quit_watch_later.
2013-09-20 21:21:40 +02:00
wm4 c52ca90492 af_export: fix compilation warning
Blargh.
2013-09-20 21:21:27 +02:00
wm4 939d34e8f1 Config path functions can return NULL
It's quite unlikely, but functions like mp_find_user_config_file() can
return NULL, e.g. if $HOME is unset.

Fix all the code that didn't check for this correctly yet.
2013-09-20 21:21:23 +02:00
wm4 bb2238516b path: fix undefined behavior
The homepath variable was static, and its value was set to a stack
buffer. This means a second invocation of the function would trigger
undefined behavior. Moreover the stack buffer always went out of scope
before homepath was used.
2013-09-20 21:20:58 +02:00
wm4 ab816f1ab1 mplayer: read subtitle packets as soon as possible
Call update_subtitles() on every iteration of the playloop, so that
subtitle packets are read as soon as possible, instead of every time a
video frame is displayed. This helps in case the packet queue is swamped
with subtitle packets, which can happen with certain insane mkv files.
The change will simply cause the subtitle queue to be emptied on each
playloop iteration.

The timestamps update_subtitles() uses for display are the same before
and after this commit. (Important for files which have subtitle packets
with timestamps or duration not set.)
2013-09-20 21:20:36 +02:00
wm4 7b8d360288 demux_mkv: don't add too many subtitle packets during seeking
In insane files with a very huge number of subtitle events, and if the
--demuxer-mkv-subtitle-preroll option is given, seeking can still
overflow the packet queue. Normally, the subtitle_preroll variable
specifies the maximum number of packets that can be added. But once this
number is reached, the normal seeking behavior is enabled, which will
add all subtitle packets with the right timestamps to the packet queue.
At this point the next video keyframe can still be quite far away, with
enough subtitle packets on the way to overflow the packet queue.

Fix this by always setting an upper limit of subtitle packets read
during seeking. This should provide additional robustness even if the
preroll option is not used.

This means that even with normal seeking, at most 500 subtitle packets
are demuxed. Packets after that are discarded.

One slightly questionable aspect of this commit is that subtitle_preroll
is never reset in audio-only mode, but that is probably ok.
2013-09-20 21:20:33 +02:00
wm4 3394072795 manpage: remove bogus space in example usage 2013-09-20 21:20:29 +02:00
wm4 4adcbe4d9c manpage: remove version and date fields
These would have to be updated manually all the time. Replacing them
automatically would be possible, but additional work, and would force
regeneration of the manpage way too often.

We decided that we don't need these fields.
2013-09-20 21:20:22 +02:00
Stefano Pigozzi b3a0557bc8 stream_dvd: prevent segmentation fault with some broken files
I have a sample where some final chapters are missing. This was causing a
segmentation fault when trying to fetch chapter times for them.

This makes the code ignore those chapters.
2013-09-20 21:19:30 +02:00
Bilal Syed Hussain 15dd1d1f8d macosx: add webm the filetypes handled by the bundle 2013-09-20 21:19:25 +02:00
Stefano Pigozzi 94cf61e9b8 README: add clarification about --enable 2013-09-20 21:19:13 +02:00
Stefano Pigozzi dc83660175 README: update Contact info with Mailing Lists 2013-09-20 21:19:10 +02:00
wm4 11602fd31a mplayer: print a message when writing watch_later config for resume
Putting this into stable, because it might help debugging certain
issues, and also making the user aware what's happening.
2013-09-20 21:18:32 +02:00
wm4 7973487a4c Release 0.1.6 2013-09-13 22:04:48 +02:00
xylosper c2ba42e02d vd_lavc: reset last_sample_aspect_ratio in uninit_avctx()
In init_vo(), if sh->aspect is 0 or last_sample_aspect_ratio is set,
sh->aspect is overwritten. With software decoding fallback behaviour,
this makes the aspect ratio from container ignored since
last_sample_aspect_ratio is already set in first try with hardware
decoding.
2013-09-13 22:04:47 +02:00
Stefano Pigozzi 1b8affee0e macosx_application: fix file opening on 10.9 (for real this time)
I did commit 86c05655d by thinking `mpv` already removed the `mpv` from
argc/argv. It actually is still there, so the argc must be 1 to check for no
arguments.

Thanks to @Nyx0uf for pointing out the bug and for testing on 10.9!
2013-09-13 22:04:47 +02:00
Stefano Pigozzi 0f1a871d65 macosx: always active bundle path lookup if cocoa is active
This is not really something you want to disable anyway. If there is no bundle
the code already does it's falbacks anyway.
2013-09-13 22:04:47 +02:00
Stefano Pigozzi 2e5610c23a macosx_application: fix file opening on OS X 10.9 (hopefully)
File opening through Finder, apparently drops `--psn` arguments on Mavericks
and just uses no args. Modify the code to account for that case.

This wasn't tested on 10.9 itself (I don't have a paid dev account), but it
*should* work if I understood the problem correctly.
2013-09-13 22:04:47 +02:00
Martin Herkt c472782c3e mpvcore/path: Fix non-MinGW builds
Well that was dumb.
2013-09-13 22:04:47 +02:00
Martin Herkt 601c285d83 mpvcore/path: Fix config path handling on Windows
Previously, mpv incorrectly used the %HOME% environment variable on
MinGW to determine the current user’s home directory. This is wrong;
the correct variable to use would be %HOMEPATH%, which would however
still be wrong since application data goes into the application data
directory, not the user’s home. This patch makes it use the local
AppData path instead of reading an environment variable.

This however exposed another problem (which also affected users who
actually had the %HOME% variable set):
b2c2fe7a37 (discussed in issue #95) introduced some changes that
make mpv load user config files from the executable path on Windows.
The problem with this change is that config_dir was still declared
static, so once a config file had been found in the executable path,
it would set config_dir to an empty string, so mpv would dump e.g.
watch_later data straight into the user’s home. This commit also
fixes that.

One side effect of this is that mpv no longer considers the “mpv”
subdirectory in the executable path (that behavior resulted from
the homedir variable always being empty), unless it is somehow
unable to determine the local AppData path.
2013-09-13 22:04:47 +02:00
Stefano Pigozzi b950afb6ea Makefile: update DIRS to fix cleaning
Commits 40624100 and 72f2942df didn't update the variable accordingly.
2013-09-13 22:04:47 +02:00
Alexander Preisinger 3ed671e369 wayland/common: improved error messages
The previous error message were not very usefull.
Also include a hint where to look for solutions.

Conflicts:
	video/out/wayland_common.c
2013-09-10 18:11:58 +02:00
15 changed files with 111 additions and 56 deletions

No files matched your search

+1 -1
View File
@@ -438,7 +438,7 @@ Available filters are:
``drc[=method:target]``
Applies dynamic range compression. This maximizes the volume by compressing
the audio signal's dynamic range.
the audio signal's dynamic range. (Formerly called ``volnorm``.)
``<method>``
Sets the used method.
+1
View File
@@ -169,6 +169,7 @@ Command Line Switches
``--mixer`` AO suboptions (``alsa``, ``oss``)
``--mixer-channel`` AO suboptions (``alsa``, ``oss``)
``--ao=alsa:device=hw=0.3`` ``--ao=alsa:device=[hw:0,3]``
``-af volnorm`` ``--af=drc`` (renamed)
=========================== ========================================
.. note::
+1 -3
View File
@@ -12,9 +12,7 @@ a movie player
##############
:Author: wm4
:Date: 2013-09-08
:Copyright: GPLv3
:Version: git
:Manual section: 1
:Manual group: multimedia
@@ -34,7 +32,7 @@ SYNOPSIS
| **mpv** \dvb://[card\_number@]channel [options]
| **mpv** \mf://[filemask|\@listfile] [-mf options] [options]
| **mpv** cdda://track[-endtrack][:speed][/device] [options]
| **mpv** [file|mms[t]|http|httpproxy|rt[s]p|ftp|udp|smb]:// [user:pass\@]URL[:port] [options]
| **mpv** [file|mms[t]|http|httpproxy|rt[s]p|ftp|udp|smb]://[user:pass\@]URL[:port] [options]
DESCRIPTION
+22 -6
View File
@@ -47,22 +47,26 @@ If you are running Mac OSX and using homebrew we provide [homebrew-mpv][homebrew
to date formula that compiles mpv with sensible dependencies and defaults for
OSX.
configure --enable-* parameters
-------------------------------
### configure `--enable-*` parameters
The --enable-* parameters unconditionally force options on, completely
The `--enable-*` parameters unconditionally force options on, completely
skipping autodetection. This behavior is unlike what you may be used to from
autoconf-based configure scripts that can decide to override you. This greater
level of control comes at a price. You may have to provide the correct compiler
and linker flags yourself.
If you used one of these options and experience a compilation or
linking failure, make sure you have passed the necessary compiler/linker flags
to configure.
mpv's configure script is greedy and automatically enables features as a result
of autodetection. The cases where you may want to use `--enable-*` are very
limited.
Bug reports
-----------
Please use the [issue tracker][issue tracker] provided by GitHub to send us bug
Please use the [issue tracker][issue-tracker] provided by GitHub to send us bug
reports or feature requests.
Contributing
@@ -75,9 +79,21 @@ make code review easier for both parties later on.
Contacts
--------
You can find us on IRC in `#mpv-player` on `irc.freenode.net`
These forms of contact are meant to ask questions about mpv usage, give
feedback on mpv and discuss it's development.
If possible, please avoid posting bugs here and use the [issue tracker][issue-tracker]
instead.
- **Users IRC Channel**: `#mpv-player` on `irc.freenode.net`
- **Users Mailing List**: `mpv-users@googlegroups.com` ([Archive / Subscribe][mpv-users]).
- **Devel Mailing List**: `mpv-devel@googlegroups.com` ([Archive / Subscribe][mpv-devel])
To contact the `mpv` team in private write to `mpv-team@googlegroups.com`.
[changes]: https://github.com/mpv-player/mpv/blob/master/DOCS/man/en/changes.rst
[mpv-build]: https://github.com/mpv-player/mpv-build
[homebrew-mpv]: https://github.com/mpv-player/homebrew-mpv
[issue tracker]: https://github.com/mpv-player/mpv/issues
[issue-tracker]: https://github.com/mpv-player/mpv/issues
[mpv-users]: https://groups.google.com/forum/?hl=en#!forum/mpv-users
[mpv-devel]: https://groups.google.com/forum/?hl=en#!forum/mpv-devel
@@ -86,6 +86,7 @@
<string>VCD</string>
<string>VFW</string>
<string>VOB</string>
<string>WEBM</string>
<string>WMV</string>
<string>asf</string>
<string>avi</string>
@@ -119,6 +120,7 @@
<string>vcd</string>
<string>vfw</string>
<string>vob</string>
<string>webm</string>
<string>wmv</string>
</array>
<key>CFBundleTypeIconFile</key>
+1 -1
View File
@@ -1 +1 @@
0.1.6
0.1.7
+5
View File
@@ -99,6 +99,11 @@ static int control(struct af_instance* af, int cmd, void* arg)
for(i = 1; i < af->data->nch; i++)
s->buf[i] = (uint8_t *)s->buf[0] + i*s->sz*af->data->bps;
if (!s->filename) {
mp_msg(MSGT_AFILTER, MSGL_FATAL, "[export] No filename set.\n");
return AF_ERROR;
}
// Init memory mapping
s->fd = open(s->filename, O_RDWR | O_CREAT | O_TRUNC, 0640);
mp_msg(MSGT_AFILTER, MSGL_INFO, "[export] Exporting to file: %s\n", s->filename);
+20 -5
View File
@@ -232,6 +232,7 @@ static int init(struct ao *ao)
{
struct pa_sample_spec ss;
struct pa_channel_map map;
pa_proplist *proplist = NULL;
struct priv *priv = ao->priv;
char *host = priv->cfg_host && priv->cfg_host[0] ? priv->cfg_host : NULL;
char *sink = priv->cfg_sink && priv->cfg_sink[0] ? priv->cfg_sink : NULL;
@@ -298,16 +299,26 @@ static int init(struct ao *ao)
if (!pa_sample_spec_valid(&ss)) {
mp_msg(MSGT_AO, MSGL_ERR, "AO: [pulse] Invalid sample spec\n");
goto fail;
goto unlock_and_fail;
}
if (!select_chmap(ao, &map))
goto fail;
if (!(priv->stream = pa_stream_new(priv->context, "audio stream", &ss,
&map)))
goto unlock_and_fail;
if (!(proplist = pa_proplist_new())) {
mp_msg(MSGT_AO, MSGL_ERR, "AO: [pulse] Failed to allocate proplist\n");
goto unlock_and_fail;
}
(void)pa_proplist_sets(proplist, PA_PROP_MEDIA_ROLE, "video");
if (!(priv->stream = pa_stream_new_with_proplist(priv->context,
"audio stream", &ss,
&map, proplist)))
goto unlock_and_fail;
pa_proplist_free(proplist);
proplist = NULL;
pa_stream_set_state_callback(priv->stream, stream_state_cb, ao);
pa_stream_set_write_callback(priv->stream, stream_request_cb, ao);
pa_stream_set_latency_update_callback(priv->stream,
@@ -344,6 +355,10 @@ fail:
&& ao->probing))
GENERIC_ERR_MSG(priv->context, "Init failed");
}
if (proplist)
pa_proplist_free(proplist);
uninit(ao, true);
return -1;
}
+19 -14
View File
@@ -197,7 +197,8 @@ typedef struct mkv_demuxer {
#define RAPROPERTIES5_SIZE 70
// Maximum number of subtitle packets that are accepted for pre-roll.
#define NUM_SUB_PREROLL_PACKETS 100
// (Subtitle packets added before first A/V keyframe packet is found with seek.)
#define NUM_SUB_PREROLL_PACKETS 500
/**
* \brief ensures there is space for at least one additional element
@@ -2269,9 +2270,16 @@ static int handle_block(demuxer_t *demuxer, struct block_info *block_info)
if (mkv_d->v_skip_to_keyframe)
use_this_block = 0;
} else if (track->type == MATROSKA_TRACK_SUBTITLE) {
if (!use_this_block && mkv_d->subtitle_preroll) {
mkv_d->subtitle_preroll--;
if (!use_this_block && mkv_d->subtitle_preroll)
use_this_block = 1;
if (use_this_block) {
if (mkv_d->subtitle_preroll) {
mkv_d->subtitle_preroll--;
} else {
// This could overflow the demuxer queue.
if (mkv_d->a_skip_to_keyframe || mkv_d->v_skip_to_keyframe)
use_this_block = 0;
}
}
if (use_this_block) {
if (laces > 1) {
@@ -2563,7 +2571,7 @@ static struct mkv_index *seek_with_cues(struct demuxer *demuxer, int seek_id,
if (index) { /* We've found an entry. */
uint64_t seek_pos = index->filepos;
if (mkv_d->subtitle_preroll) {
if (flags & SEEK_SUBPREROLL) {
uint64_t prev_target = 0;
for (int i = 0; i < mkv_d->num_indexes; i++) {
if (seek_id < 0 || mkv_d->indexes[i].tnum == seek_id) {
@@ -2600,10 +2608,9 @@ static void demux_mkv_seek(demuxer_t *demuxer, float rel_seek_secs,
a_tnum = track->tnum;
}
}
mkv_d->subtitle_preroll = 0;
if ((flags & SEEK_SUBPREROLL) && st_active[STREAM_SUB] &&
st_active[STREAM_VIDEO])
mkv_d->subtitle_preroll = NUM_SUB_PREROLL_PACKETS;
mkv_d->subtitle_preroll = NUM_SUB_PREROLL_PACKETS;
if (!st_active[STREAM_SUB] || !st_active[STREAM_VIDEO])
flags &= ~SEEK_SUBPREROLL;
if (!(flags & (SEEK_BACKWARD | SEEK_FORWARD))) {
if (flags & SEEK_ABSOLUTE || rel_seek_secs < 0)
flags |= SEEK_BACKWARD;
@@ -2632,14 +2639,13 @@ static void demux_mkv_seek(demuxer_t *demuxer, float rel_seek_secs,
if (!index)
stream_seek(demuxer->stream, old_pos);
if (st_active[STREAM_VIDEO])
mkv_d->v_skip_to_keyframe = 1;
mkv_d->v_skip_to_keyframe = st_active[STREAM_VIDEO];
mkv_d->a_skip_to_keyframe = st_active[STREAM_AUDIO];
if (flags & SEEK_FORWARD)
mkv_d->skip_to_timecode = target_timecode;
else
mkv_d->skip_to_timecode = index ? index->timecode * mkv_d->tc_scale
: 0;
mkv_d->a_skip_to_keyframe = 1;
demux_mkv_fill_buffer(demuxer);
} else if ((demuxer->movi_end <= 0) || !(flags & SEEK_ABSOLUTE))
@@ -2675,10 +2681,9 @@ static void demux_mkv_seek(demuxer_t *demuxer, float rel_seek_secs,
mkv_d->cluster_end = 0;
stream_seek(s, index->filepos);
if (st_active[STREAM_VIDEO])
mkv_d->v_skip_to_keyframe = 1;
mkv_d->v_skip_to_keyframe = st_active[STREAM_VIDEO];
mkv_d->a_skip_to_keyframe = st_active[STREAM_AUDIO];
mkv_d->skip_to_timecode = index->timecode * mkv_d->tc_scale;
mkv_d->a_skip_to_keyframe = 1;
demux_mkv_fill_buffer(demuxer);
}
+12 -11
View File
@@ -628,9 +628,11 @@ static void mk_config_dir(char *subdir)
{
void *tmp = talloc_new(NULL);
char *confdir = talloc_steal(tmp, mp_find_user_config_file(""));
if (subdir)
confdir = mp_path_join(tmp, bstr0(confdir), bstr0(subdir));
mkdir(confdir, 0777);
if (confdir) {
if (subdir)
confdir = mp_path_join(tmp, bstr0(confdir), bstr0(subdir));
mkdir(confdir, 0777);
}
talloc_free(tmp);
}
@@ -867,6 +869,8 @@ void mp_write_watch_later_conf(struct MPContext *mpctx)
if (!conffile)
goto exit;
mp_msg(MSGT_CPLAYER, MSGL_INFO, "Saving state.\n");
FILE *file = fopen(conffile, "wb");
if (!file)
goto exit;
@@ -1789,7 +1793,7 @@ static void reset_subtitles(struct MPContext *mpctx)
osd_changed(mpctx->osd, OSDTYPE_SUB);
}
static void update_subtitles(struct MPContext *mpctx, double refpts_tl)
static void update_subtitles(struct MPContext *mpctx)
{
struct MPOpts *opts = mpctx->opts;
if (!(mpctx->initialized_flags & INITIALIZED_SUB))
@@ -1808,7 +1812,7 @@ static void update_subtitles(struct MPContext *mpctx, double refpts_tl)
mpctx->osd->video_offset = track->under_timeline ? mpctx->video_offset : 0;
double refpts_s = refpts_tl - mpctx->osd->video_offset;
double refpts_s = mpctx->playback_pts - mpctx->osd->video_offset;
double curpts_s = refpts_s + opts->sub_delay;
if (!track->preloaded) {
@@ -2790,8 +2794,6 @@ static bool redraw_osd(struct MPContext *mpctx)
if (vo_redraw_frame(vo) < 0)
return false;
if (mpctx->sh_video)
update_subtitles(mpctx, mpctx->sh_video->pts);
draw_osd(mpctx);
vo_flip_page(vo, 0, -1);
@@ -3511,7 +3513,7 @@ static void run_playloop(struct MPContext *mpctx)
mpctx->video_pts = sh_video->pts;
mpctx->last_vo_pts = mpctx->video_pts;
mpctx->playback_pts = mpctx->video_pts;
update_subtitles(mpctx, sh_video->pts);
update_subtitles(mpctx);
update_osd_msg(mpctx);
draw_osd(mpctx);
@@ -3598,11 +3600,10 @@ static void run_playloop(struct MPContext *mpctx)
}
mpctx->playback_pts = a_pos;
print_status(mpctx);
if (!mpctx->sh_video)
update_subtitles(mpctx, a_pos);
}
update_subtitles(mpctx);
/* It's possible for the user to simultaneously switch both audio
* and video streams to "disabled" at runtime. Handle this by waiting
* rather than immediately stopping playback due to EOF.
+2 -2
View File
@@ -78,12 +78,12 @@ char *mp_find_config_file(const char *filename)
char *mp_find_user_config_file(const char *filename)
{
char *homedir = NULL, *buff = NULL;
static char *homepath = NULL;
char *homepath = NULL;
#ifdef __MINGW32__
char *config_dir = "mpv";
char buf[MAX_PATH];
if (homepath == NULL) {
char buf[MAX_PATH];
if (SHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA|CSIDL_FLAG_CREATE, NULL,
SHGFP_TYPE_CURRENT, buf) == S_OK) {
+2 -2
View File
@@ -496,7 +496,7 @@ static int get_chapter_time(ifo_handle_t *vts_file, tt_srpt_t *tt_srpt, int titl
last_cell = pgc->program_map[ptt[i].pgn];
else
last_cell = 0;
do {
while (cell < last_cell) {
if(!(pgc->cell_playback[cell-1].block_type == BLOCK_TYPE_ANGLE_BLOCK &&
pgc->cell_playback[cell-1].block_mode != BLOCK_MODE_FIRST_CELL)
) {
@@ -508,7 +508,7 @@ static int get_chapter_time(ifo_handle_t *vts_file, tt_srpt_t *tt_srpt, int titl
cur++;
}
cell++;
} while(cell < last_cell);
}
}
return 0;
}
+1 -1
View File
@@ -250,7 +250,7 @@ static struct vf_instance *vf_open(struct MPOpts *opts, vf_instance_t *next,
goto error;
vf->priv = priv;
int retcode = vf->info->vf_open(vf, (char *)args);
if (retcode < 0)
if (retcode < 1)
goto error;
return vf;
+11 -5
View File
@@ -569,8 +569,11 @@ static bool create_display (struct vo_wayland_state *wl)
{
wl->display.display = wl_display_connect(NULL);
if (!wl->display.display)
if (!wl->display.display) {
MP_ERR(wl->vo, "failed to connect to a wayland server: "
"check if a wayland compositor is running\n");
return false;
}
wl_list_init(&wl->display.output_list);
wl->display.registry = wl_display_get_registry(wl->display.display);
@@ -644,7 +647,7 @@ static bool create_input (struct vo_wayland_state *wl)
wl->input.xkb.context = xkb_context_new(0);
if (!wl->input.xkb.context) {
MP_ERR(wl, "failed to initialize input\n");
MP_ERR(wl->vo, "failed to initialize input: check xkbcommon\n");
return false;
}
@@ -680,7 +683,6 @@ int vo_wayland_init (struct vo *vo)
|| !create_window(wl)
|| !create_cursor(wl))
{
MP_ERR(wl, "failed to initialize backend\n");
return false;
}
@@ -766,8 +768,12 @@ static int vo_wayland_check_events (struct vo *vo)
* when pausing no input events get queued so we have to check if there
* are events to read from the file descriptor through poll */
if (poll(&fd, 1, 0) > 0) {
if (fd.revents & POLLERR || fd.revents & POLLHUP)
MP_ERR(wl, "error occurred on the display fd\n");
if (fd.revents & POLLERR || fd.revents & POLLHUP) {
MP_FATAL(wl, "error occurred on the display fd: "
"closing file descriptor\n");
close(wl->display.display_fd);
mp_input_put_key(vo->input_ctx, MP_KEY_CLOSE_WIN);
}
if (fd.revents & POLLIN)
wl_display_dispatch(dp);
if (fd.revents & POLLOUT)
+11 -5
View File
@@ -455,6 +455,7 @@ int vo_x11_init(struct vo *vo)
if (!x11->display) {
mp_msg(MSGT_VO, MSGL_ERR,
"vo: couldn't open the X11 display (%s)!\n", dispName);
talloc_free(x11);
vo->x11 = NULL;
return 0;
@@ -469,6 +470,9 @@ int vo_x11_init(struct vo *vo)
}
x11->xim = XOpenIM(x11->display, NULL, NULL, NULL);
if (!x11->xim)
mp_msg(MSGT_VO, MSGL_WARN,
"x11: XOpenIM() failed. Unicode input will not work.\n");
init_atoms(vo->x11);
@@ -982,11 +986,13 @@ static void vo_x11_create_window(struct vo *vo, XVisualInfo *vis, int x, int y,
x11->mouse_cursor_hidden = false;
vo_set_cursor_hidden(vo, true);
}
x11->xic = XCreateIC(x11->xim,
XNInputStyle, XIMPreeditNone | XIMStatusNone,
XNClientWindow, x11->window,
XNFocusWindow, x11->window,
NULL);
if (x11->xim) {
x11->xic = XCreateIC(x11->xim,
XNInputStyle, XIMPreeditNone | XIMStatusNone,
XNClientWindow, x11->window,
XNFocusWindow, x11->window,
NULL);
}
vo_x11_update_window_title(vo);
}