summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* ao_pulse: implement AO device listing APIwm42014-10-101-1/+38
| | | | | | | | | | | | | | | | While conceptually this sink stuff in PulseAudio does just the right thing, actually listing the sinks is unbelievable complicated. Not only is the idea that listing them should happen asynchronously completely bullshit (who the fuck runs the PulseAudio server on a separate computer), but the way this is done is full of bullshit too. Why separate callbacks for each device? Why this obtuse mainloop shit? Especially the mainloop shit makes it actively worse than doing things manually with pthread primitives, and the reason for that (different mainloop implementations for GUIs?) is laughable too. It's like they chose the most complicated API possible just because they attempted to "abstract" basic mechanisms in order to handle "everything". While I don't claim to design the best APIs, this API is fucking terrible without any excuse. (End of rant.)
* ao_pulse: move setup code to separate functionwm42014-10-101-23/+48
| | | | | | | All the dumb crap in pa_init_boilerplate() is needed to talk to the audio server at all. Might also fix some subtle bugs in the init code (which is strange, because the original file was contributed by the devil himself).
* audio: change internal device listing APIwm42014-10-105-28/+54
| | | | | Now we run ao_driver->list_devs on a dummy AO instance, which will probably confuse everyone. This is done for the sake of PulseAudio.
* player: exit if audio init fails and there's no videowm42014-10-101-0/+2
| | | | | | Seems logical. For some reason, the player allows deselecting both audio and video stream without quitting (a deliberate feature of which I have no idea why it was added years ago), so this is needed.
* player: signal EOF when using --frameswm42014-10-102-2/+2
|
* player: minor simplificationwm42014-10-102-8/+2
|
* player: don't close audio device in gapless modewm42014-10-101-2/+1
| | | | I don't see much of a reason for this extra corner case.
* player: --save-position-on-quit should always work (2)wm42014-10-102-5/+5
| | | | | This reimplements the feature reverted in the previous commit in a different way.
* Revert "player: --save-position-on-quit should always work"wm42014-10-103-8/+5
| | | | | | | | | This reverts commit 45c8b97efbaff7a5031b008223eeed56f7b0607a. Some else complained (github issue #1163). The feature requested in #1148 will be implemented differently in the following commit.
* Add some missing "const"swm42014-10-109-14/+16
| | | | | | | The one in msg.c was mistakenly removed with commit e99a37f6. I didn't actually test the change in ao_sndio.c (but obviously "ap" shouldn't be static).
* audio/out/push: make draining slightly more robustwm42014-10-101-1/+1
| | | | | | | | Don't wait after the audio thread has pushed the remaining audio to the AO. Avoids hard hangs if the heuristic fails completely (could still happen if get_delay returns absurd values). CC: @mpv-player/stable
* audio/out/push: fix EOF heuristicwm42014-10-102-23/+14
| | | | | | | | | | | | | Since the internal AO driver API has no proper way to determine EOF, we need to guess by querying get_delay. But some AOs (e.g. ao_pulse with no-latency-hacks set) may never reach 0, maybe because they naively add the latency to the buffer level. In this case our heuristic can break. Fix by always using the delay to estimate the EOF time. It's not even that important - it's mostly used to avoid blocking draining. So this should be ok. CC: @mpv-player/stable (maybe)
* fix -Wvisibility warnings with clangStefano Pigozzi2014-10-091-2/+1
| | | | Now everything compiles with no warnings! yay!
* cocoa: post keydown and keyup events without event monitorStefano Pigozzi2014-10-095-0/+20
| | | | | Our code worked under the assumption that the event monitor is always active and we did remove the keydown and keyup overrides from our cocoa view.
* fix -Wduplicate-decl-specifier warnings with clangStefano Pigozzi2014-10-092-4/+4
|
* libmpv/cocoa: don't start the event monitorStefano Pigozzi2014-10-095-11/+35
| | | | | | The event monitor is used to get keyboard events when there is no window, but since it is a global monitor to the current process, we don't want it in a library setting.
* cocoa: fix 'uninitalized' accessStefano Pigozzi2014-10-091-9/+7
| | | | | I think this doesn't make a difference, since in Objective-C nil responds as a NullObject, but better not depend on this crappy language feature.
* libmpv/cocoa: make global events work and get rid of is_cplayerStefano Pigozzi2014-10-095-10/+15
| | | | | | | After @frau's split of macosx_events from macosx_application, `is_cplayer' is not needed anymore. At the moment only global events such as Media Keys and Apple Remote work, because the VO-level ones were hardcoded to be disabled. (that will be fix in a later commit ).
* manpage: fix --audio-pitch-correction descriptionAlessandro Ghedini2014-10-091-4/+4
| | | | Add closing ">" and specify what is the default value.
* x11: fix inverted conditionwm42014-10-091-2/+3
| | | | | | | Worryingly wrong. Fixes #1162. Also fix another issue (window title was set anyway), which was why I didn't notice this and testing it seemed to be fine.
* client API: add an explanatory commentwm42014-10-091-1/+1
| | | | | So someone reading this at least has a chance to find out what this is needed for.
* ao_alsa: implement device listing & selectionwm42014-10-091-0/+27
| | | | | | | Unfortunately, ALSA is particularly bad with this, because mpv has to add all sorts of magic crap to the device name to make things work. The device selection overrides this, so explicitly selecting devices will most likely break your audio. This has yet to be solved.
* audio: add device selection & listing with --audio-devicewm42014-10-097-6/+128
| | | | | | | Not sure how good of an idea this is. This commit doesn't add support for this to any AO yet; the AO implementations will follow later.
* manpage: improve --wid descriptionwm42014-10-091-8/+19
| | | | In particular, add a basic description of how Cocoa embedding works.
* client API: rename --input-x11-keyboard to --input-vo-keyboardwm42014-10-097-12/+18
| | | | | Apparently we need this for Cocoa too. (The option was X11 specific in the hope that only X11 would need this hack.)
* vf_lavfi: proper rounding for lavfi->mpv aspect ratiowm42014-10-091-2/+3
| | | | Or so I think. Not like it matters anyway.
* video: try harder to decode cover art picture only oncewm42014-10-091-2/+7
| | | | | | | | | | | | | | | | | For cover art, we pretend that the video stream is infinite, but also stop decoding once we have an image on the VO (this seems advantageous for the case when strange filters are inserted or the VO image gets lost). Since a while ago, the video chain started decoding 2 images though ("Non-monotonic video pts: 0.000000 <= 0.000000"), which is annoying and wasteful. Improve this by handling a certain corner case at initialization, which will decode a second image while the first one is still stuck in the filter chain. Also, just in case there are filters which buffer a lot, also force EOF filtering (which means we tell the filters to flush buffered frames). CC: @mpv-player/stable
* player: don't reset buffering pausing state on seekswm42014-10-091-1/+0
| | | | | | | | This was added with commit 3cbd79b3, but it turns out this unintentionally enables "real" pausing when seeking while buffering. It was done for ensuring correct state of the "cache-buffering-state" property, but it also turns out that this was unneeded (another variable that is reset when seeking happens to take care of this).
* cocoa: allow to embed into an arbitrary NSViewStefano Pigozzi2014-10-086-19/+34
| | | | | Basically add if guards on all the problematic features. I'm still thinking about a better way to handle this, but for the time being, this will do.
* msg: fix unwanted blank lineswm42014-10-081-1/+3
| | | | Was broken in a commit earlier this day.
* client API: introduce numeric log levelswm42014-10-085-1/+41
| | | | | | | | | | | | | | | | Maybe using strings for log levels was a mistake (too broad and too impractical), so I'm adding numeric log level at least for the receiver side. This makes it easier to map mpv log levels to other logging systems. I'm still too stingy to add a function to set the log level by a numeric value, though. The numeric values are not directly mapped to the internal mpv values, because then almost every file in mpv would have to include the client API header. Coalesce this into API version 1.6, since 1.6 was bumped just yesterday.
* DOCS/client_api_examples: qtexample: add a log windowwm42014-10-082-0/+29
| | | | | | | | For the purpose of demonstration. Also make the windows larger. I'm not exactly sure how Qt determines the default window sizes, but here they are a bit tiny, so force them larger.
* msg, client API: buffer partial lineswm42014-10-083-68/+77
| | | | | | | | | | | | | | | The API could return partial lines, meaning the message could stop in the middle of a line, and the next message would have the rest of it (or just the next part of it). This was a pain for the user, so do the nasty task of buffering the lines ourselves. Now only complete lines are sent. To make things even easier for the API user, don't put multiple lines into a single event, but split them. The terminal output code needed something similar (inserting a prefix header on start of each line). To avoid code duplication, this commit refactors the terminal output so that lines are split in a single place.
* msg, client API: never send the status line as log messagewm42014-10-081-1/+1
| | | | | | | | | | | | | The status line is a bit special; for example it uses special control codes by design and is not terminated with a newline character in order to update it on the terminal without scrolling. It's not helpful for client API users either, and would require special-casing them (emulating aspects of a terminal?). Also, the status line code is explicitly disabled on osd.c unless the --terminal option is enabled, so there was no good way to even enable the status line for the API. Just pretend that the status line does not exist as far as the client API is concerned. It won't be sent as MPV_EVENT_LOG_MESSAGE.
* msg: set an explicit overflow messagewm42014-10-082-2/+5
| | | | | | | | So client API users don't have to worry about this specifically. Also document the overflow case. (Not sure if we really need to do this; maybe it'd be better not to, since this just adds more noise to the docs.)
* vf_lavfi: fix compilation failurewm42014-10-081-1/+0
| | | | | | Apparently this fails to compile with clang6. Patch by someone else. CC: @mpv-player/stable
* stream: change internal instead of external pos when dropping bufferswm42014-10-081-0/+1
| | | | | | | | | | | | | | | | | | | stream provides a read buffer (so even something like stream_read_char() is very fast). This means the stream reads ahead by a few KBs, and implies that the internal position (s->pos, which would match e.g. the file position in stream_file.c), and the external position (stream_tell()) can be different. stream_tell() shows how these are related. When dropping buffers, which happens on byte-level discontinuities with a bunch of streams (including DVB), we should not change the position as seen by the demuxer. On the other hand, the internal position is not really meaningful, since these streams aren't seekable anyway. So just change the code such that stream_drop_buffers() doesn't change the demuxer visible position. I'm hoping that this will fix a few problems with DVB. (Also see previous commit.)
* stream_dvb: use stream_drop_buffers()wm42014-10-081-2/+1
|
* player: minor cosmetic changewm42014-10-081-1/+1
|
* x11: disable various features when embedding the windowwm42014-10-071-3/+5
|
* player: remove unnecessary codewm42014-10-071-3/+1
| | | | This part is already done by open_stream_async().
* command: add cache-buffering-state propertywm42014-10-074-1/+35
|
* client API: improve mpv_observe_property docswm42014-10-071-11/+18
| | | | | | | Document the "normal" behavior (if MPV_FORMAT_NONE is not used) first, and then introduce MPV_FORMAT_NONE as exception. The actual semantics didn't change in mpv; this is only clarification.
* client API: clarify pause/unpause events, modify core-idle propertywm42014-10-074-6/+24
| | | | | | | | Whether you consider the semantics weird or not depends on your use case, but I suppose it's a bit confusing anyway. At this point, we keep MPV_EVENT_PAUSE/UNPAUSE for compatibility only. Make the "core-idle" property somewhat more useful in this context.
* DOCS/client_api_examples: qtexample: set the localeJames Ross-Gowan2014-10-071-0/+6
| | | | | | | QApplication sets the locale, so change the LC_NUMERIC category back to "C" for libmpv. See: http://qt-project.org/doc/qt-5/qcoreapplication.html#locale-settings
* bstr: check strings before memcmp/strncasecmpJames Ross-Gowan2014-10-071-2/+6
| | | | | | | | | bstr.start can be NULL when bstr.len is 0, so don't call memcmp or strncasecmp if that's the case. Passing NULL to string functions is invalid C, even when the length is 0, and it causes Windows to raise an invalid parameter error. Should fix #1155
* matroska: look for all known matroska file extensionswm42014-10-061-5/+18
| | | | | | For segment linking (this mechanism matches file extensions to avoid opening files which are most likely not Matroska files in order to speed up scanning).
* osd: don't let slow commands cut OSD messages shortwm42014-10-062-1/+9
| | | | Done for screenshot commands, requested by a user.
* player: --save-position-on-quit should always workwm42014-10-063-5/+8
| | | | | | | | | | | Now any action that stops playback of a file (even playlist navigation) will save the position. Normal EOF is of course excluded from this, as well as commands that just reload the current file. The option name is now slightly off, although you could argue what the word "quit" means. Fixes #1148 (or at least this is how I understood it).
* demux_lavf: blacklist jpeg fileswm42014-10-061-0/+1
| | | | | | | We handle them under demux_mf.c for stupid reasons; mostly so that an image is shown for a second instead of just flashing it. CC: @mpv-player/stable
* ao_pulse: don't use pa_format_info_to_sample_spec()wm42014-10-061-9/+4
| | | | | | | | | | | This function is available starting with PulseAudio 2.0, while we only require 1.0. This broke compilation on Ubuntu 12.04.5 LTS. Use our own function to calculate the buffer size, which is actually simpler and needs slightly less code. Hopefully fixes #1154. CC: @mpv-player/stable
* player: open stream and demuxer asynchronouslywm42014-10-066-19/+146
| | | | | | | | | | | | | | | | | | | | | | | | | Run opening the stream and opening the demuxer in a separate thread. This should remove the last code paths in which the player can normally get blocked on network. When the stream is opened, the player will still react to input and so on. Commands to abort opening can also be handled properly, instead of using some of the old hacks in input.c. The only thing the user can really do is aborting loading by navigating the playlist or quitting. Whether playback abort works depends on the stream implementation; with normal network, this will depend on what libavformat (via "interrupt" callback) does. Some pain is caused by DVD/BD/DVB. These want to reload the demuxer sometimes. DVB wants it in order to discard old, inactive streams. DVD/BD for the same reason, and also for reloading stream languages and similar metadata. This means the stream and the demuxer have to be loaded separately. One minor detail is that we now need to copy all global options. This wasn't really needed before, because the options were accessed on opening only, but since opening is now on a separate thread, this obviously becomes a necessity.
* m_config: add function to copy all optionswm42014-10-063-1/+25
| | | | Needed to copy the global option struct in the next commit.
* cocoa: try to fix sizing bugs on retina displaysStefano Pigozzi2014-10-061-2/+2
| | | | untested, no hardware.
* cocoa: fix mouse autohideStefano Pigozzi2014-10-051-1/+1
| | | | broken in 547b62f
* cocoa: remove a debug commentoStefano Pigozzi2014-10-051-1/+1
| | | | fixup previous commit
* cocoa: separate video view and events viewStefano Pigozzi2014-10-057-19/+92
|
* cocoa: fix fullscreen with bundleStefano Pigozzi2014-10-051-1/+1
|
* audio/out/push: fix some AOs freezing on exitwm42014-10-051-1/+1
| | | | Caused by a dumb deadlock.
* cocoa: readd some function callsStefano Pigozzi2014-10-051-1/+3
|
* cocoa: actually reset the event flagsStefano Pigozzi2014-10-051-0/+1
|
* cocoa: remove some useless flagsStefano Pigozzi2014-10-051-19/+10
|
* cocoa: disable some features when embedding in another windowStefano Pigozzi2014-10-051-23/+25
| | | | ontop, fullscreen and window title change to be precise
* cocoa: remove --fs-missioncontrolStefano Pigozzi2014-10-057-73/+4
| | | | | | | This is the first of a series of commits that will change the Cocoa way in a way that is easily embeddable inside parent views. To reach that point common code must avoid referencing the parent NSWindow since that could be the host application's window.
* cocoa: fix some pointer casts to be 32bit safeStefano Pigozzi2014-10-052-2/+2
| | | | credits: wm4
* cocoa/libmpv: allow to embed mpv GL view in another windowStefano Pigozzi2014-10-054-32/+123
| | | | | | | | | | | | | | | | | | | This is just temporary code but is a good base for future work (and baby steps are required for these changes). The 'final destination' is embedding the video view into any NSView but that requires some more work (the mechanism will be the same: pass the view's pointer casted to int64_t through -wid). For instance we will need to remove as much usage of the window instance as possible, and use nil guards where not possible. For this reason I will remove stuff like the mission control fullscreen feature (it's a cute feature but annoying to support and quite limited, go make your GUIs), and a way to lookup the current screen directly from the NSView absolute coordinates (this is needed for ICC detection mostly, and reporting back the screen to mpv's core). Moreover the current view.m will need to be separated into 2 views: the actual video view that will be embedded, and a parent view that will not be embedded and will be responsibile for tracking events.
* examples/cocoa: never instance NSApplication with newStefano Pigozzi2014-10-051-1/+1
| | | | | Cocoa expects the you instance NSApplications only through the singleton method sharedApplication.
* examples/cocoa: set activation policy to mimic nib applicationsStefano Pigozzi2014-10-051-0/+8
|
* cocoa: simplify the config code and run it on th