summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* input: add convenience function for running input sources in threadswm42014-09-102-1/+91
|
* input: make some fields internalwm42014-09-102-13/+19
|
* terminal-unix: don't read from stdin if it's not a terminalwm42014-09-101-1/+1
| | | | | | I'm not quite sure what we should actually do (maybe read input commands?), but interpreting input as terminal key sequences is definitely weird. So just do nothing.
* terminal-unix: move to threadwm42014-09-106-63/+74
| | | | | | | Do terminal input with a thread, instead of using the central select() loop. This also changes some details how SIGTERM is handled. Part of my crusade against mp_input_add_fd().
* terminal-win: minor simplificationwm42014-09-101-2/+2
| | | | Code should be equivalent.
* win32: don't request window size larger than the screenwm42014-09-101-3/+34
| | | | | | | | | | | | | | | | | An attempt at fixing #1070. Apparently something goes wrong if the video size is equal to the screen size. Since the window decorations add to the window size, it must actually be larger than the screen. Actually I don't know what exactly is going wrong, but since this commit also slightly improves the behavior otherwise, it's a win anyway. Try to keep the window size strictly below screen size, even accounting for window decorations. Size it down and center the window so that it fits (by either touching the left/right or top/bottom screen borders). I haven't found any information on what is the maximum allowed size and position of a window so that it doesn't collide with the task bar, so assume that we can use the entire screen, minus 1 pixel to avoid triggering fullscreen semantics (if that is even possible).
* player: reset some VO state when video is terminatedwm42014-09-091-0/+3
| | | | | Useful for idle mode or if video is switched off during playback, and --force-window is used.
* player: deal with some corner cases with playlist navigationwm42014-09-094-19/+39
| | | | | | | | | | | | | | | The purpose is making accessing the current playlist entry saner when commands are executed during initialization, termination, or after playlist navigation commands. For example, the "playlist_remove current" command will invalidate playlist->current - but some things still access the playlist entry even on uninit. Until now, checking stop_play implicitly took care of it, so it worked, but it was still messy. Introduce the mpctx->playing field, which points to the current playlist entry, even if the entry was removed and/or the playlist's current entry was moved (e.g. due to playlist navigation).
* player: normalize playlist entries on addwm42014-09-092-5/+2
| | | | This is not necessarily more correct, but it's less trouble.
* input: fix missed wakeups, simplifywm42014-09-091-26/+10
| | | | | mp_input_read_cmd() reset the wakeup flag, but only mp_input_wait() should be able to do that.
* ao_pulse: fix typo in error messagewm42014-09-081-1/+1
| | | | Closes #1076.
* input: fix use after free with legacy commandswm42014-09-081-7/+11
| | | | | | | | To handle legacy commands, string replacement is used; the modified string is returned by parse_cmd_str(), but it also frees all temporary memory, which includes the replaced string. Closes #1075.
* input: fix exiting with signalswm42014-09-081-2/+2
| | | | | Quitting through SIGTERM etc. was accidentally ignored since commit f5af5962 from today.
* stream: change cache return valueswm42014-09-072-7/+7
| | | | | Basically a cosmetic change, because currently the player just continues even if the cache fails initializing.
* player: some more input refactoringwm42014-09-076-73/+42
| | | | | | | | | | | | | | | | | Continues commit 348dfd93. Replace other places where input was manually fetched with common code. demux_was_interrupted() was a weird function; I'm not entirely sure about its original purpose, but now we can just replace it with simpler code as well. One difference is that we always look at the command queue, rather than just when cache initialization failed. Also, instead of discarding all but quit/playlist commands (aka abort command), run all commands. This could possibly lead to unwanted side-effects, like just ignoring commands that have no effect (consider pressing 'f' for fullscreen right on start: since the window is not created yet, it would get discarded). But playlist navigation still works as intended, and some if not all these problems already existed before that in some forms, so it should be ok.
* win32: copy event flags after running VOCTRLswm42014-09-071-5/+2
| | | | | | | | | reinit_window_state() will set VO_EVENT_RESIZE when it runs, so we don't need to set it manually depending on the VOCTRL. Probably avoids duplicated resize events. I don't expect this actually fixes anything, but might help spotting other bugs easier (if there are any).
* lua: synchronously wait until scripts are loadedwm42014-09-064-5/+49
| | | | | | | | | | | | | | | | | This makes the player wait until each script is loaded. Do this to give the script a chance to setup all its event handlers. It might also be useful to allow a script to change options that matter for playback. While waiting for a script to be loaded, the player actually accepts input. This is needed because the scripts can execute player commands anyway while they are being "loaded". The player won't react to most commands though: it can't quit or navigate the playlist in this state. For deciding whether a script is finally loaded, we use a cheap hack: if mpv_wait_event() is called, it's considered loaded. Let's hope this is good enough. I think it's better than introducing explicit API for this. Although I'm sure this will turn out as too simplistic some time in the future, the same would probably happen with a more explicit API.
* player: minor refactoringwm42014-09-062-22/+31
| | | | | | | Expose the central event handling functions explicitly, so that other parts of the player can use them. No functional changes. Preparation for the next commit.
* audio/out: fix active waiting during pause againwm42014-09-061-1/+2
| | | | | This was fixed in commit 8432eaefa, and commit 39609fc1 of course broke it again. This was pretty stupid.
* vo_corevideo: remove this VOStefano Pigozzi2014-09-066-594/+4
| | | | | | | This was kept in the codebase because it is slightly faster than --vo=opengl on really old Intel cards (from the GMA era). Time to kill it, and let it rest. Fixes #1061
* stream_lavf: assume icy title data is terminated with ';'wm42014-09-061-1/+1
| | | | Should fix #1071.
* audio: fix initial sync with huge AO bufferwm42014-09-061-1/+1
| | | | | | | | | | | | | | With e.g --start=-3 --audio-buffer=10 the decoder entered EOF state before the initial sync was finished, entered STATUS_EOF, and just started playing audio from a random position. This doesn't handle seeking outside of the file, which is a different case. E.g. --start=30:00 with audio and video enabled in a file shorter than 30:00 will play a random last part of audio. This could perhaps be fixed by using the hr-seek target for cutting audio, instead of the video PTS, but that would be kind of intrusive, so don't do it for now. The simpler solution, assuming audio EOF on video EOF, wouldn't work, because we allow audio to start before video, or to last after video.
* audio/out/push: redo audio waitingwm42014-09-061-45/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | Improve the logic how the audio thread decides how to wait until the AO is ready for new data. The previous commit makes some of this easier, although it turned out that it wasn't required, and we still can handle AOs with bad get_space implementation (although the new code prints an error message, and it might fail in obscure situations). The new code is pretty similar to the old one, and the main thing that changes is that complicated conditions are tweaked. AO waiting is now used better (mainly instead of max>0, r>0 is used). Whether to wakeup is reevaluated every time, instead of somehow doing the wrong thing and compensating for it with a flag. This fixes the specific situation when the device buffer is full, and we don't want to buffer more data. In the old code, this wasn't handled correctly: the AO went to sleep forever, because it prevented proper wakeup by the AO driver, and as consequence never asked the core for new data. Commit 4fa3ffeb was a hack-fix against this, and now that we have a proper solution, this hack is removed as well. Also make the refill threshold consistent and always use 1/4 of the buffer. (The threshold is used for situations when an AO doesn't support proper waiting or chunked processing.) This commit will probably cause a bunch of regressions again.
* audio/out: always round get_space on period sizewm42014-09-064-4/+6
| | | | | | | | | | | Round get_space() results in the same way play() rounds the input size. Some audio APIs do this for various reasons. This affects only "push" based AOs. Some of these need no change, because they either do it already right (like ao_openal), or they seem not to have any such requirements (like ao_pulse). Needed for the following commit.
* ao_sndio: fix a commentwm42014-09-061-2/+2
| | | | | Whether this code was written with the correct assumptions in mind, I don't know.
* ao_pcm: minor simplificationwm42014-09-061-1/+1
|
* ao_oss: minor simplificationwm42014-09-061-3/+1
| | | | Equivalent code.
* mplayer-input.conf: fix broken bindingwm42014-09-061-1/+1
| | | | | | | "#" starts a comment, so the # key needs to be handled specially. MPlayer has the same issue, but its input.conf is wrong. Or at least I think it's wrong; looking at the MPlayer code it's doubtful they somehow special-case and handle this.
* audio/out: remove old thingswm42014-09-0611-31/+27
| | | | | | | | Remove the unnecessary indirection through ao fields. Also fix the inverted result of AOCONTROL_HAS_TEMP_VOLUME. Hopefully the change is equivalent. But actually, it looks like the old code did it wrong.
* sub: fix possible deadlock with --no-sub-ass and similarwm42014-09-062-6/+3
| | | | | | | | | | | | | | | This is a deadlock caused by a lock order issue: sub/osd.c locks the OSD first, then the subtitle decoder lock. player/sub.c does the reverse. Fix this by discussing away the requirement for locking (see below), which allows us to drop the broken sub lock. sub_get_text() still acquires and releases the sub decoder lock, but it's not held at the same time as the OSD lock anymore, so it should be fine. Originally, the sub lock was acquired because sub_get_text() returns a pointer to a mutable string. We simply declare that it's ok to call it unlocked, as long as only 1 thread accesses it, which works out fine in this case.
* audio/out: make EOF handling properly event-basedwm42014-09-054-6/+52
| | | | | | | | | | | | | | | | | With --gapless-audio=no, changing from one file to the next apparently made it hang, until the player was woken up by unrelated events like input. The reason was that the AO doesn't notify the player of EOF properly. the played was querying ao_eof_reached(), and then just went to sleep, without anything waking it up. Make it event-based: the AO wakes up the playloop if the EOF state changes. We could have fixed this in a simpler way by synchronously draining the AO in these cases. But I think proper event handling is preferable. Fixes: #1069 CC: @mpv-player/stable (perhaps)
* vo_sdl: fix typowm42014-09-051-1/+1
|
* af_hrtf: request required samplerate, instead of erroring outwm42014-09-051-8/+1
| | | | | | | | It seems hrtf works in 48khz only - and if that wasn't the input, the filter just exited with an error. Make it request the 48khz instead. The player will insert a resampling filter. Not sure why it wasn't done like this in the first place.
* af_hrtf: cosmetics: reindent misaligned code blockwm42014-09-051-8/+8
|
* audio: correctly initialize output bufferwm42014-09-051-0/+6
| | | | | | | Just like the previous commit, this takes care of fallout from commit 7ab228, which fixed a bug, but introduced some new ones. CC: @mpv-player/stable
* player: check for null in resume config searchJames Ross-Gowan2014-09-051-1/+2
| | | | | | Signed-off-by: wm4 <wm4@nowhere> CC: @mpv-player/stable
* win32: add tmpfile() replacementJames Ross-Gowan2014-09-053-3/+39
| | | | | | | | | | | The Windows version of tmpfile is actually pretty broken. It tries to create the file in the root directory of the current drive, which means on Vista and up, it normally fails due to insufficient permissions. Replace it with a version that uses GetTempPath. Also remove the Windows-specific note about automatic deletion of the cache file. FILE_FLAG_DELETE_ON_CLOSE is available in NT, and it should be pretty reliable.
* audio: fix random crashes on uninitwm42014-09-051-2/+1
| | | | I added this non-sense earlier this day. Oops.
* manpage: fix sub_add descriptionwm42014-09-051-1/+1
| | | | | It is in fact selected. The manpage wasn't updated when this was changed.
* malloc+memset(0) to callocBruno George de Moraes2014-09-057-17/+9
| | | | Signed-off-by: wm4 <wm4@nowhere>
* audio: make buffer size configurablewm42014-09-056-6/+23
| | | | Really only for testing.
* audio: fix obscure audio resync failure with timelineswm42014-09-052-3/+6
| | | | | | | | | | | | | | | | | Somehow, there was a larger misunderstanding in the code: ao_buffer does not need to be preserved over audio reinit for proper support of gapless audio. The actual AO internal buffer takes care of this. In fact, preserving ao_buffer just breaks audio resync. In the ordered chapter case, end_pts is used, which means not all audio data in the buffer is played, thus some data is left over when audio decoding resumes on the next segment. This triggers some code that aborts resync if there's "audio decoded" (ao_buffer contains something), but no PTS is known (nothing was actually decoded yet). Simplify, and always bind the output buffer to the decoder. CC: @mpv-player/stable (maybe)
* cosmetics: remove a stray ';'wm42014-09-051-1/+1
|
* build: handle insane libavcodec API bullshitwm42014-09-053-11/+37
| | | | | | | | | | | | | | | | | | | | | The oldest supported FFmpeg release doesn't provide av_vdpau_alloc_context(). With these versions, the application has no other choice than to hard code the size of AVVDPAUContext. (On the other hand, there's av_alloc_vdpaucontext(), which does the same thing, but is FFmpeg specific - not sure if it was available early enough, so I'm not touching it.) Newer FFmpeg and Libav releases require you to call this function, for ABI compatibility reasons. It's the typcal lakc of foresight that make FFmpeg APIs terrible. mpv successfully pretended that this crap didn't exist (ABI compat. is near impossible to reach anyway) - but it appears newer developments in Libav change the function from initializing the struct with all-zeros to something else, and mpv vdpau decoding would stop working as soon as this new work is relewased. So, add a configure test (sigh). CC: @mpv-player/stable
* video: rename VOCTRL_GET_WINDOW_SIZEwm42014-09-056-12/+16
| | | | Make it clear that this accesses the un-fullscreened window size.
* ebml: warn if there are too many subelementswm42014-09-041-3/+7
| | | | Seems like a good idea.
* demux_mkv: allow up to 256 MB of extradata to make broken files workwm42014-09-041-1/+1
| | | | | | | | What the flying fuck? Unfortunately, these are already in the wild. CC: @mpv-player/stable
* build: add a check_program checkStefano Pigozzi2014-09-031-1/+6
| | | | | | | | | | | | | | | | | | | This wraps waf's find_program in our own check boilerplate code so that it can be used in the declarative dependencies section of the wscript. Can be used like this: }, { 'name': 'sed', 'desc': 'sed program', 'func': check_program('sed', 'SED'), }, { First argument is the program name, and the second is the waf variable name where the program path will be stored. In this example we will be able to refer to sed with ${{SED}} when creating waf Tasks in wscript_build. /cc @giselher: I think you need this for wayland-scanner.
* wayland: print some useful outptu infoAlexander Preisinger2014-09-032-15/+21
| | | | | Prints output informations, useful for finding out if we detect the right mode and for debugging.
* wayland: only save current mode of outputsAlexander Preisinger2014-09-031-1/+2
| | | | Other ones are not needed.
* x11: add rewind and forward keysKenneth Zhou2014-09-031-2/+4
| | | | Signed-off-by: wm4 <wm4@nowhere>
* path: remove XDG bullshitwm42014-09-031-23/+1
| | | | | | | | | | | | | Don't worry, your ~/.config/... paths are safe. This merely removes handling of $XDG_CONFIG_DIRS for global paths. Maybe there is a better solution for this, like still including the "traditional" config dir. But I will leave the fine reading of this (crappy) spec and fixing the code accordingly to someone else. So, if anyone has interest in getting this behavior back, you will have to write a patch. This patch should _also_ not break expected behavior. Fixes #1060.
* demux: allow increasing filepos onlywm42014-09-031-1/+2
| | | | | | | | | | | The last demuxed file position (demuxer->filepos) is used to estimate the total playback percentage in files with possible timestamp resets (like MPEG-PS). Until know, reading from any stream set this position freely. This makes the position jump around. Fix this by allowing icnreasing file position only. Reset it on seeking. With crazy formats, this still could go wrong, but there's only so much you can do.
* player: add --media-title optionwm42014-09-024-0/+11
| | | | Requested by ChrisK2.
* player: properly resume playlists loaded at runtimewm42014-09-021-0/+3
| | | | | | | If a playlist is loaded from the internal playlist (like "mpv playlist.m3u"), then attempt to resume from it. CC: @mpv-player/stable
* player: add --osd-playing-msg optionwm42014-09-024-5/+22
|
* player: show HLS bitrate as fallback for track titleswm42014-09-011-0/+2
| | | | | | HLS streams as demuxed by libavformat have no track title metadata. So show the HLS bitrate if no title is set. Could be useless or annoying, so it's a bit controversial, I guess.
* player: simplistic HLS bitrate selectionwm42014-09-016-13/+44
| | | | | | --hls-bitrate=min/max lets you select the min or max bitrate. That's it. Something more sophisticated might be possible, but is probably not even worth the effort.
* command: remove broken quvi-format propertywm42014-09-014-86/+0
| | | | Never really worked, and libquvi is probably a lost cause anyway.
* demux: get rid of old wrapperwm42014-09-013-8/+1
| | | | | demux_info_get() used to be central, but was turned into a wrapper, and now there was only one caller left. Get rid of it.
* command: make m_property_strdup_ro with NULL mean unavailablewm42014-09-011-0/+2
| | | | | | | | | | This catches a few cases which basically call: m_property_strdup_ro(..., ..., NULL) which would return NULL strings. This should generally be avoided (although it's allowed due to reasons), and it seems most callers actually intend this to mean M_PROPERTY_UNAVAILABLE.
* command: disable some commands/properties properly in idle modewm42014-09-011-2/+21
| | | | | In particular, don't allow to add any external subtitle tracks in idle mode. This make no sense and would just lead to leaks or worse.
* player: reset playback-related fields right on startwm42014-09-011-23/+17
|
* man: fix a whole bunch of typosMartin Herkt2014-09-0111-130/+130
|
* player: don't allow remote playlists to load local fileswm42014-09-015-10/+23
| | | | | | | | Because that might be a bad idea. Note that remote playlists still can use any protocol marked with is_safe and is_network, because the case of http-hosted playlists containing URLs using other streaming protocols is not unusual.
*