summaryrefslogtreecommitdiffstats
path: root/player
Commit message (Collapse)AuthorAgeFilesLines
* OSC: idlemessage: fix alignmentChrisK22015-01-251-3/+3
|
* OSC: display "drop files here" message when idle + forced-windowChrisK22015-01-251-2/+52
| | | | This currently doesn't work properly on OSX due to some bugs.
* player: print config.h contents in verbose modewm42015-01-251-6/+14
| | | | | | | | | | | | It was requested that mpv should print what features etc. have been enabled at compile time. It can print the configure command line, but it obviously doesn't include autodetected features. I tried to think of a nicer way than dumping the config.h as text, but this was still the simplest way. Conflicts: player/main.c
* command: make the "run" command work on Windows toowm42015-01-251-22/+35
| | | | | | | | | | | | Do so by using mp_subprocess(). Although this uses completely different code on Unix too, you shouldn't notice a difference. A less ncie thing is that this reserves an entire thread while the command is running (which wastes some memory for stack, at least). But this is probably still the simplest way, and the fork() trick is apparently not implementable with posix_subprocess(). Conflicts: player/command.c
* command: stip path from playlist OSD displaywm42015-01-251-2/+8
| | | | | | But only if it's not e.g. a http URL. Fixes #1388.
* command: ignore chapter cycling if there's only 1 chapterwm42015-01-251-2/+5
| | | | | | | | | If there's only 1 chapter, the seeking by chapter (using the chapter property) will either jump to the chapter point, or quit playback. This is as designed, but seems like a useless and annoying behavior. Conflicts: player/command.c
* player: fix random crashes on uninitializationwm42015-01-251-0/+1
| | | | | | | | | | | On uninitialization, the player will unselect all subtitles, and then destroy the subtitle decoder. But it didn't correctly remove the subtitle decoder from the OSD state, so it could happen that it would access it after the decoder was destroyed. Could lead to random crashes when switching files often. Fixes #1389.
* player: cosmetics: rename a functionwm42015-01-253-7/+7
| | | | | | | | Something which has this many important sideffects shouldn't start have a "get" prefix. Conflicts: player/sub.c
* client API: fix mpv_wakeup()wm42015-01-251-2/+2
| | | | | | Of course this was going to get stuck in the retry loop. Fixes #1372.
* client API: be more lenient about mpv_suspend/resume mismatcheswm42015-01-253-29/+53
| | | | | | | | | | | | Before this commit, this was defined to trigger undefined behavior. This was nice because it required less code; but on the other hand, Lua as well as IPC support had to check these things manually. Do it directly in the API to avoid code duplication, and to make the API more robust. (The total code size still grows, though...) Since all of the failure cases were originally meant to ruin things forever, there is no way to return error codes. So just print the errors.
* player: update chapter marks when switching fileswm42015-01-251-1/+4
| | | | | | | | This wasn't done, so the chapter marks of the previous file were visible. It's harmless, but looks unpolished, so fix it. Conflicts: player/command.c
* player: don't ignore relative seeks by 0 secondswm42015-01-251-4/+0
| | | | | | | I don't know why this done; most likely it had no real reason. Remove it because it breaks "refresh seeks" to the same position. (Although the refresh seeks mpv sometimes does were fine.)
* command: avoid returning invalid FPS valueswm42015-01-251-3/+5
| | | | It's possible that fps is sometimes 0 in case it's unset.
* player: reset frame step counter on seekswm42015-01-252-1/+1
| | | | | I suppose this wasn't done in order to keep the frame step counter active even in the next file, but actually it was reset anyway.
* lua: add a function that formats Lua values as stringswm42015-01-251-16/+21
| | | | | | | | Yep, Lua is so crappy that the stdlib doesn't provide anything like this. Repurposes the undocumented mp.format_table() function and moves it to mp.utils.
* ytdl_hook: Check for empty playlistsChrisK22015-01-251-1/+7
| | | | | Sometimes we get empty playlists back, print a warning message instead of crash
* player: respect --untimed on last framewm42015-01-251-1/+3
| | | | | | | | | | | | | | The last video frame is another case that has a separate code path, although it's pretty similar to the one in commit 73e5aa87. Fix this in a different way, which also takes care of the last frame case, although without context the code becomes slightly more tricky. As further cleanup, move the decision about framedropping itself to the same place, so the check in vo.c becomes much simpler. The check for the vo->driver->encode flag, which is remvoed completely, was redundant too. Fixes #1480.
* player: respect --untimed on video format changeswm42015-01-251-1/+1
| | | | | | | | | | | If the video format changes (e.g. different frame size), a special code path is entered to wait until the currently displayed frame is done. Otherwise, the frame before the change would be destroyed by the vo_reconfig() call. This code path didn't respect --untimed; correct this. Fixes #1475.
* player: don't fall asleep on audio decoding errorswm42015-01-251-0/+2
| | | | | | This makes it retry later. Fixes #1474.
* player: fix --stop-playback-on-init-failure on audio init failurewm42015-01-251-2/+1
| | | | | | | This was forgotten when the option was implemented, and makes this option work as advertised. Fixes #1473 (though the default behavior is probably still stupid).
* command: make empty vf-metadata not an errorwm42015-01-251-11/+6
| | | | | | | | If a filter exists, but has no metadata, just return success. This allows the user to distinguish between no metadata available, and filter not inserted. See #1408.
* options: expand ~ for the include optionStefano Pigozzi2015-01-251-1/+5
| | | | Fixes #1406
* player: make --shuffle/--merge-files affect runtime loaded playlistswm42015-01-254-15/+26
| | | | | | | Until now, these options took effect only at program start. This could be confusing when e.g. doing "mpv list.m3u --shuffle". Make them always take effect when a playlist is loaded either via a playlist file, or with the "loadlist" command.
* sub: reset sub decoder correctly when cycling subtitleswm42015-01-251-3/+1
| | | | | | | | | | reset_subtitles() works in mpctx->d_sub[], which is set to NULL before calling it from uninit_sub(). This fixes resetting the subtitle when cycling subtitle tracks. Actually, this was probably a feature, because it's annoying if subtitles don't show up when cycling them. But it also can have unintended consequences, so get rid of it.
* lua: don't ignore key press events for script key bindingswm42015-01-251-2/+2
| | | | Meh.
* client API: fix log buffer overflow casewm42015-01-251-3/+3
| | | | | | | It just crashed. The prefix and text fields point to static strings in this case. Oops. Fixes the issue mentioned in #838.
* player: fix crash wtih --secondary-sidwm42015-01-251-2/+3
| | | | Fises #1463.
* tl_matroska: fix minor memory leak in error casewm42015-01-251-5/+7
| | | | Going the way of least resistance. Fixes #1460.
* player: check sufficient track selection before destroying VOwm42015-01-251-9/+9
| | | | | | | | | | | | | | | | mpv needs at least an audio or video track to play something. If the track selection is basically insufficient, the player will immediately skip to the next file (or quit). One slightly annoying thing might be that trying to play a subtitle file will close the VO window, and then go to the next file immediately (so "mpv 1.mkv 2.srt 3.mkv" would flash the video window when 2.srt is skipped). Move the check to before the video window is possibly closed. This is a minor cosmetic issue; one can use --force-window to avoid closing the video window at all. Fixes #1459.
* video: fix timeline with some container formatswm42015-01-251-0/+2
| | | | | | Using edl or --merge-files with .avi files didn't work, because the DTS was not offset. Only the PTS was adjusted, which led to nonsense timestamps.
* ytdl: silence "succeeded" messagewm42015-01-251-1/+1
| | | | Pretty useless by now.
* Update copyright yearwm42015-01-251-1/+1
|
* player: ordered chapters: filter missing chapterswm42015-01-251-0/+9
| | | | | | | | | | | | Ever since someone (not me) added some Matroska features which nobody ever uses (ordered edition or some bullshit), I haven't had a fucking clue what the fuck is going on in this fucking file. (Still agreed to it, so it's my fault.) mplayer2 handled missing chapters correctly (and I suppose in a somewhat clean/simple manner), but the changed code doesn't. Since I can't even follow this code because it's so arcanely complicated, just add a hack that has the same effect.
* player: fix a typo in message outputwm42015-01-141-1/+1
| | | | This typo has been around for over a year. Oops.
* player: don't show "0%" percentage in infinite streamswm42015-01-142-4/+9
|
* ytdl: bump requrired youtube-dl version to 2014.11.26ChrisK22014-12-191-1/+1
|
* ytdl: Try to handle multi-arc videosChrisK22014-12-191-14/+37
| | | | | | | | this currently uses a sketchy but apparently working workaround, which will be removed once the neccessary changes in youtube-dl are implemented Fixes #1277
* ytdl: When using DASH, print actual durationChrisK22014-12-191-1/+5
| | | | | prints the actual duration as reported by youtube-dl to the terminal when available
* command: fix crash with some forms of script_bindingwm42014-12-171-1/+1
| | | | "script_binding name ..." just crashed it. Oops.
* player: restore ab-loop settings with playback resumewm42014-12-171-0/+2
| | | | Fixes #1324.
* build: fix --disable-libasswm42014-12-171-2/+2
| | | | | | Still supported, but obviously untested. You shouldn't use this option anyway.
* sub: remove assertionwm42014-12-081-2/+1
| | | | | | | | | | | This should clearly be impossible, but it seems to happen with ordered chapters for a user. Since I can't tell what the actual bug is and it seems impossible to know the details without downloading possibly huge files, this is probably the best we can do. Should at least partially fix #1319.
* osc, dvd, bd: fix mouse state when changing menu modeswm42014-12-082-4/+9
| | | | | | | | | The flags weren't correctly set, and the mouse cursor remained visible after leaving menu mode. This was apparently broken in 0.7.0 too. Fixes #1316.
* discnav: remove redundant callwm42014-12-081-2/+0
| | | | This was made the default a while ago.
* dvd, bd, osc: disable OSC while a menu is activewm42014-12-071-0/+9
| | | | | | | They interfere. It turns out that commit b6ca4a48 actually broke this in weird ways, but this solution is better anyway.
* osc: always force mouse_move bindingwm42014-12-071-1/+1
| | | | | | So the OSC will still appear when using --no-input-default-bindings. It also means it may override a user's mouse_move binding, but I guess users who don't want the OSC should just use the --no-osc option.
* lua: fix broken error messagewm42014-12-071-1/+1
| | | | | luaL_error() doesn't support %.*s, because it uses Lua's own format string mechanism that just looks like the C one. Just drop this part.
* player: don't signal an error if --stream-dump is usedwm42014-12-071-0/+1
| | | | | | | The player thinks an error happened because no audio or video was played after finishing the file, but this obviously makes no sense with stream dumping. (error_playing follows the client API convention that negative values are errors.)
* player: simplify and fix ordered chapter EOF handlingwm42014-12-012-17/+11
| | | | | | | | | | | | | | Ordered chapter EOF was handled as special-case of ending the last segment. This broke --kee-open, because it set AT_END_OF_FILE in an "inconvenient" place (after checking for --keep-open, and before the code that exits playback if EOF is reached). We don't actually need to handle the last segment specially. Instead, we remain in the same segment if it ends. The normal playback logic will recognize EOF, because the end of the segment "cuts off" the file. Now timeline_set_from_time() never "fails", and we can remove the old segment EOF handling code in mp_seek().
* command: sub_add with "auto" should not always select a subtitle trackwm42014-12-011-1/+3
| | | | | | | | | | | Running "sub_add file.srt auto" during hook execution automatically selected the first added track. This happened because all tracks added with sub_add are marked as "external", and external subtitles are always selected by default. Fix this by negating the "external" flag when autoselecting subtitles during loading. The no_default flag exists for this purpose; it was probably added for libquvi originally, where we had the same issue.
* audio: alternative fix for previous commitwm42014-11-281-4/+1
| | | | | | | This is a somewhat obscure situation, and happens only if audio starts again after it has ended (in particular can happens with files where audio starts later). It doesn't matter much whether audio starts immediately or some milliseconds later, so simplify it.
* audio: fix busy loop when seeking while pausedwm42014-11-281-2/+4
| | | | | | | | | | | | | | | | | | | | When playing paused, the amount of decoded audio is limited to a small amount (1 sample), because we don't write any audio to the AO when paused. The small amount could trigger the case of the wanted audio being too far in the future in the PTS sync code, which set the audio status to STATUS_DRAINING, which in turn triggered the EOF code in the next iteration. This was ok, but unfortunately, this triggered another retry in order to check resuming from EOF by setting the status to STATUS_SYNCING, which in turn lead to the busy loop by alternating between the 2 states. So don't try resyncing while paused. Since the PTS syncing code also calls ao_reset(), this could cause the pulseaudio daemon to consume some CPU time as well. This was caused by commit 33b57f55. Before that, the playloop was merely run more often, but didn't cause any problems. Fixes #1288.
* client API: make sure youtube-dl is not used by defaultwm42014-11-251-0/+1
| | | | | | | Currently, --ytdl is off by default, but even if this is changed, never enable it by default for the client API. It would be inappropriate to start an intrusive external subprocess behind the host application's back.
* audio: make mp_audio_config_to_str return a stack-allocated stringwm42014-11-251-3/+2
| | | | Simpler overall.
* audio: make mp_chmap_to_str() return a stack-allocated stringwm42014-11-241-1/+1
| | | | Simplifies memory management.
* lua: remove redundant callwm42014-11-241-1/+0
|
* lua: always handle key repeat on the script sidewm42014-11-241-4/+5
| | | | | | Simpler, and leaves the decision to repeat or not fully to the script (instead of requiring the user to care about it when remapping a script binding).
* lua, ipc: remove leftoverswm42014-11-242-10/+0
| | | | | | MPV_EVENT_SCRIPT_INPUT_DISPATCH is now unused/deprecated. Also remove a debug-print from defaults.lua.
* command: don't queue framestepswm42014-11-231-1/+14
| | | | | If repeated framestep commands are sent, just unpause the player, instead of playing N frames for N repeated commands.
* player: don't crash when using sub_seek without subtitleswm42014-11-231-2/+0
| | | | | | Recent regression. It turns out the assertion was completely unneeded. Fixes #1285.
* input, lua: redo input handlingwm42014-11-234-43/+145
| | | | | Much of it is the same, but now there's the possibility to distinguish key down/up events in the Lua API.
* client API: restrict client nameswm42014-11-232-20/+22
| | | | | | Use a fixed size array for the client name, which also limits the client name in size. Sanitize the client name string, and replace characters that are not in [A-Za-z0-9] with '_'.
* input: set mouse area by default for all inputwm42014-11-231-1/+1
| | | | | | | | | | Otherwise, mouse button bindings added by mp.add_key_binding() would be ignored. It's possible that this "breaks" some older scripts using undocumented Lua script functions, but it should be safe otherwise. Fixes #1283.
* lua: subprocess: move to osdep/subprocess-{win,posix}.cJames Ross-Gowan2014-11-221-478/+3
| | | | | | The subprocess code was already split into fairly general functions, separate from the Lua code. It's getting pretty big though, especially the Windows-specific parts, so move it into its own files.
* lua: subprocess: use macros for SetHandleInformationJames Ross-Gowan2014-11-221-1/+2
| | | | | Apparently both parameters refer to the same set of flags (the first is a mask for which flags to set.)
* lua: subprocess: fix handle inheritance race conditionJames Ross-Gowan2014-11-221-11/+87
| | | | | | | | | | | | | | | Normally, when creating a process with inherited handles on Windows, the process inherits all inheritable handles from the parent, including ones that were created on other threads. This can cause a race condition, where unintended handles are copied into the new process, preventing them from being closed correctly while the process is running. The only way to prevent this on Windows XP was to serialise the creation of all inheritable handles, which is clearly unacceptable for libmpv. Windows Vista solves this problem by allowing programs to specify exactly which handles are inherited, so do that on Vista and up. See http://blogs.msdn.com/b/oldnewthing/archive/2011/12/16/10248328.aspx
* lua: subprocess: fix Ctrl+C handling on WindowsJames Ross-Gowan2014-11-221-3/+11
| | | | |