summaryrefslogtreecommitdiffstats
path: root/player
Commit message (Collapse)AuthorAgeFilesLines
* command: add window-minimized property (X11 only)wm42014-11-023-0/+21
| | | | | | More or less requested by #1237. Should be simple to extend this to other backends.
* command: make window-scale property observablewm42014-11-024-4/+19
| | | | | | | | | | | | Add a generic mechanism to the VO to relay "extra" events from VO to player. Use it to notify the core of window resizes, which in turn will be used to mark all affected properties ("window-scale" in this case) as changed. (I refrained from hacking this as internal command into input_ctx, or to poll the state change, etc. - but in the end, maybe it would be best to actually pass the client API context directly to the places where events can happen.)
* command: expose mpv version as propertywm42014-11-021-0/+8
| | | | A client API user has no other way to know the version.
* player: print anamorphic size only if video is anamorphicwm42014-11-021-2/+5
| | | | Has been annoying me since forever.
* player: always use demux_chapterwm42014-11-027-36/+24
| | | | | | | | | Instead of defining a separate data structure in the core. For some odd reason, demux_chapter exported the chapter time in nano-seconds. Change that to the usual timestamps (rename the field to make any code relying on this to fail compilation), and also remove the unused chapter end time.
* player: add --chapters-file optionwm42014-11-021-5/+25
| | | | | | | | Note that you can't pass .cue or .edl files to it, at least not yet. Requested in context of allowing to specify custom chapters. For that to work well, we probably need to add some sort of chapter metadata pseudo-demuxer.
* osd: properly wakeup when the OSD function disappearswm42014-11-011-3/+10
| | | | Fixes #1236.
* player: update meaning of drop_frame_cntwm42014-11-014-9/+8
| | | | | Rename the variable, update comments, and update the documentation of the property which returns its value.
* player: show AV-desync message in all framedrop modeswm42014-11-011-2/+1
| | | | | | | | | | | | This was shown only if decoder-framedropping was enabled, and only if at least 50 frames were dropped by it. Since drop_frame_cnt used to mean "number of late frames", this code made sense, but this is not the case anymore: drop_frame_cnt can be even 0, all while video gets hopelessly behind audio. One problem with this is that short desync spikes (which usually can probably dealt with) will also cause this message to be shown. If it gets triggered too often, the code will need to be adjusted.
* sub: remove osd_get_sub()wm42014-11-013-5/+7
| | | | | Trades one strange thing against another, but seems slightly less strange.
* sub: be more flexible about changes to how subtitles are renderedwm42014-10-311-20/+32
| | | | | | | | | For example, if --force-window is used, and video is switched off during playback, then you need to redecide the rendering method to get subs displayed correctly. Do this by moving the state setup code into a function, and call it on every frame.
* player: change framedrop display in the status linewm42014-10-311-4/+5
| | | | | Hopefully less confusing, and hopefully doesn't exceed the terminal width in any situation.
* player: improve exit message in some scenarioswm42014-10-313-63/+58
| | | | | | | | | | | | | | If you played e.g. an audio-only file and something bad happened that interrupted playback, the exit message could say "No files played". This was awkward, so show a different message in this case. Also overhaul how the exit status is reported in order to make this easier. This includes things such as not reporting a playback error when loading playlists (playlists contain no video or audio, which was considered an error). Not sure if I'm happy with this, but for now it seems like a slight improvement.
* player: don't display zero duration for files with unknown durationwm42014-10-294-17/+22
| | | | | | On OSD/terminal, just don't display the duration if unavailable. Make the "length" property unavailable if duration is unavailable.
* player: add an option to abort playback on partial init failureswm42014-10-283-3/+5
| | | | | | This is probably what libmpv users want; and it also improves error reporting (or we'd have to add a way to communicate such mid-playback failures as events).
* player: handle DVB demuxer reloading correctlywm42014-10-281-2/+2
| | | | | | | | This was probably done incorrectly in cases when the currently selected channel had no data. I'm not sure if this codepath is functional at all, though. Maybe not. Untested due to lack of DVB hardware.
* client API: better error reportingwm42014-10-286-24/+52
| | | | Give somewhat more information on playback failure.
* client API: add an enum for mpv_event_end_file.reasonwm42014-10-281-4/+3
| | | | | | | | | Using magic integer values was an attempt to keep the API less verbose. But it was probably not a good idea. Reason 1 (restart) is not made explicit, because it is not used anymore starting with the previous commit. For ABI compatibility, the value is left as a hole in the enum.
* player: handle edition reloading slightly differentlywm42014-10-283-11/+11
| | | | | | | Use the codepath that is normally used for DVD/BD title switching and DVB channel switching. Removes some extra artifacts from the client API: now MPV_EVENT_END_FILE will never be called on reloads (and neither is MPV_EVENT_START_FILE).
* command: play the correct entry with loadfile ... append-playAlessandro Ghedini2014-10-271-1/+1
| | | | | The playlist may be non-empty even if the player is idle. Instead of playing the first entry, play the entry that was just added.
* player: don't spam video-reconfig eventwm42014-10-271-1/+1
| | | | | | | | Without --force-window, this is called on every iteration or so, and calling uninit_video_out() sends the video-reconfig event. Avoid sending redundant events. Fixes #1225 (using an alternative patch).
* command: try 'icy-title' metadata for media-title as wellAlessandro Ghedini2014-10-271-0/+3
|
* command: add audio-device propertywm42014-10-271-0/+11
| | | | Meant for changing the --audio-device at runtime.
* audio: add command/function to reload audio outputwm42014-10-271-0/+16
| | | | | Anticipated use: simple solution for dealing with audio APIs which request configuration changes via events.
* lua: subprocess: fix dumbwm42014-10-261-1/+1
|
* lua: subprocess: tunnel stderr through mp_logwm42014-10-261-20/+63
| | | | | | | | | | | Pretty much a fringe-feature, but also it's awkward if something appears on the terminal with no indication for the source. This is made quite awkward by the fact that stderr and stdout could be closed at different times, and that poll() doesn't accept "holes" in its FD list. Invalid (.e.g negative) FDs just make it return immediately, as required by the standard. So sparse_poll() takes care of the messy details.
* lua: parse_json(): fix inverted condition for trail argumentwm42014-10-261-1/+1
| | | | It accidentally had the opposite meaning.
* lua: subprocess: don't distinguish pipe errors/EOFwm42014-10-261-7/+4
| | | | | | | What was the purpose of that? Probably none. Also simplify another thing: if we get the cancel signal through FD, there's no reason to check it separately.
* Drop libquvi supportwm42014-10-253-88/+2
| | | | | | | | | | | No development activity (or even any sign of life) for almost a year. A replacement based on youtube-dl will probably be provided before the next mpv release. Ask on the IRC channel if you want to test. Simplify the Lua check too: libquvi linking against a different Lua version than mpv was a frequent issue, but with libquvi gone, no direct dependency uses Lua, and such a clash is rather unlikely.
* lua: fix some more lua_tostring() mistakeswm42014-10-251-1/+3
| | | | Why can't it just raise an error?
* lua: lua_tostring() on an error value can return NULLwm42014-10-241-2/+4
| | | | | Lua is so clever it allows values that can't be converted to strings, in which case lua_tostring() returns NULL. Trigger undefined behavior.
* command: finish hook execution if client failswm42014-10-243-6/+33
| | | | | Translation: if the (to be added) youtube-dl Lua script crashes, don't wait forever when opening something.
* command: add vo-configured propertywm42014-10-241-1/+10
| | | | | | | | | So a client API user can know when a window is created or destroyed. Also might be useful for the OSC: it could disable itself if video is disabled. Before this commit, there were only indirect ways of detecting this.
* player: disable --force-window if VO failswm42014-10-241-1/+5
| | | | Otherwise, it'd retry creating the window all the time.
* video: send MPV_EVENT_VIDEO_RECONFIG on uninitwm42014-10-241-0/+1
| | | | | This event basically means "something about video changed", and uninit is certainly an important change.
* player: adjust uninit order of componentswm42014-10-241-6/+7
| | | | | | | | Most things should be allowed to access the client API unconditionally (for example for sending events), so move destroying the client API down. Also, mp_uninit_ipc() should happen before the point at which all clients are shutdown, or there will be a small time window in which new clients can be created after destroying them all.
* command: fix debug outputwm42014-10-241-1/+1
| | | | It was a bit ugly/annoying.
* osc: make text squuezing layout dependentChrisK22014-10-241-31/+48
| | | | | | | | | | | Wether and when the text of a button should be squeezed when it gets too long can now be configured in the layout: lo.button.maxchars = <number> nil = no squeezing (default) If the button text has more than <maxchars> characters, it will be squeezed to the estimated width of <maxchars>.
* osc: make tooltip_an default propertyChrisK22014-10-241-2/+3
|
* player: fix exiting if both audio and video fail initializingwm42014-10-234-8/+22
| | | | | | | | | | | | | The player was supposed to exit playback if both video and audio failed to initialize (or if one of the streams was not selected when the other stream failed). This didn't work; for one this check was missing from one of the failure paths. And more importantly, both checked the current_track array incorrectly. Fix these issues, and move the failure handling code into a common function. CC: @mpv-player/stable
* lua: fix non-sensewm42014-10-231-1/+1
| | | | Let's actually test our code next time.
* client API: print properties set with -vwm42014-10-231-0/+7
| | | | | Useful for debugging. Considered doing this in command.c, but it's easier here.
* command: print executed commands with -vwm42014-10-231-0/+2
|
* command: add a "cached" mode to sub_addwm42014-10-231-1/+22
| | | | | This avoids reloading a subtitle if it was already added. In all cases, the subtitle is selected.
* osc.lua: add “bottombar” and “topbar” layoutsMartin Herkt2014-10-231-5/+281
|
* command: return error on invalid/absent IDs with ff-sid/ff-aidwm42014-10-231-2/+6
| | | | | | Instead of just disabling the stream. Also, check if the selected track has the right type, or we'd crash.
* player: show busy symbol on OSD if seeking takes too longwm42014-10-221-2/+7
| | | | Same as it's done on the terminal.
* lua: don't let temporary values take the place of argumentswm42014-10-221-1/+13
| | | | | | | Because Lua is so terrible, it's easy to confuse temporary values pushed to the Lua stack with arguments if the arguments are checked after that. Add a hack that should fix this.
* command: make reverse cycle_values match up with forward onewm42014-10-211-4/+3
| | | | | | | | | The behavior of reverse cycling (with the "!reverse" magic value) was a bit weird and acted with a "delay". This was because the command set the value the _next_ command should use. Change this and make each command invocation select and use the next command directly. This requires an "uninitialized" special index in the counter, but that is no problem at all.
* command: fix video-rotate update when pausedwm42014-10-211-11/+11
| | | | | | | | | | | Due to the way video-rotate currently works, the state will be automatically updated once new video is decoded. So the filter chain doesn't need to be reinitialized automatically, but there is a need to trigger the video instant refresh code path instead. Also move the support function closer to an annoying similar yet different function. They probably can be unified next time major changes are done to this code.
* lua: don't use "output" as identifierwm42014-10-211-4/+4
| | | | | I suspect this clashes with libcs,w hich define "stdout" as macro. Hopefully fixes #1206.
* command: add cursor-autohide propertywm42014-10-211-0/+14
| | | | | | | | | | | Allows properly changing/updating the cursor state. Useful for client API window embedding, because the host application may not want the mpv window to grab mouse input, and this has to manually handle the cursor. Changing the cursor of foreign windows is usually not sane. It might make sense to allow changing the cursor icon, but that would be much more complicated, so I won't add it unless someone actually requests it.
* command: add playback-abort propertywm42014-10-211-0/+8
| | | | Now this is obscure.
* command: add video-rotate propertywm42014-10-211-0/+12
|
* player: add stream selection by ffmpeg indexwm42014-10-213-11/+55
| | | | | | | | | Apparently using the stream index is the best way to refer to the same streams across multiple FFmpeg-using programs, even if the stream index itself is rarely meaningful in any way. For Matroska, there are some possible problems, depending how FFmpeg actually adds streams. Normally they seem to match though.
* sd_lavc: strictly letter-box PGS subtitleswm42014-10-211-1/+1
| | | | | | | | | | | | | | Getting subtitle scaling and positioning right even if there are video filters, which completely change the image (like cropping), doesn't seem to have a single, correct solution. To some degree, the results are arbitrary, so we may as well do what is most useful to the user. In this case, if the PGS resolution aspect ratio and the video output aspect ratio mismatch, letter-box it, instead of stretching the subs over the video frame. (This will require additional fixes, should it turn out that there are PGS subtitles which are stretched by design.) Fixes #1205.
* command: add field-dominance propertyKevin Mitchell2014-10-211-0/+1
|
* lua: add convenience function for hookswm42014-10-211-0/+21
| | | | So the user doesn't have to care about the awkward low-level details.
* command: extend sub_add commandwm42014-10-211-2/+10
|
* command: remove hook cancellation mechanismwm42014-10-203-15/+3
| | | | | I doubt anyone will actually use this correctly. Also, there was a bug (a typo) which prevented it from working at all.
* command: allow sub_add at an earlier stagewm42014-10-201-1/+1
|
* osdep: limit thread names to 16 characterswm42014-10-201-1/+1
| | | | | | | | | | | | | | | | It turns out the glibc people are very clever and return an error if the thread name exceeds the maximum supported kernel length, instead of truncating the name. So everyone has to hardcode the currently allowed Linux kernel name length limit, even if it gets extended later. Also the Lua script filenames could get too long; use the client name instead. Another strange thing is that on Linux, unrelated threads "inherit" the name by the thread they were created. This leads to random thread names, because there's not necessarily a strong relation between these threads (e.g. script command leads to filter recreation -> the filter's threads are tagged with the script's thread name). Unfortunate.
* Set thread name for debuggingwm42014-10-193-0/+9
| | | | | | | | | | Especially with other components (libavcodec, OSX stuff), the thread list can get quite populated. Setting the thread name helps when debugging. Since this is not portable, we check the OS variants in waf configure. old-configure just gets a special-case for glibc, since doing a full check here would probably be a waste of effort.
* player: shutdown all clients before actual uninitwm42014-10-191-2/+2
| | | | | This seems safer. It might be possible that commands sent by the clients could recreate e.g. audio or video outputs.
* ipc: decouple from MPContextwm42014-10-192-10/+4
| | | | Just a minor refactor to keep unneeded dependencies on the core low.
* fix build on OS X and BSDStefano Pigozzi2014-10-191-0/+1
|
* lua: fix lua_objlen -> lua_rawlen for lua 5.2Kevin Mitchell2014-10-181-1/+3
|
* lua: strictly free memory on errorswm42014-10-192-29/+30
| | | | | | | Thanks to the recently introduced mp_lua_PITA(), this is "simple" now. It fixes leaks on Lua errors. The hack to avoid stack overflows manually isn't needed anymore, and the Lua error handler will take care of this.
* lua: expose JSON parserwm42014-10-191-0/+26
| | | | | | | The JSON parser was introduced for the IPC protocol, but I guess it's useful here too. The motivation for this commit is the same as with 8e4fa5fc (again).
* lua: add an utility function for starting processeswm42014-10-191-2/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | |