summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* input: enable wakeup on LIRC socketfoo862014-07-201-1/+1
| | | | | Commit dc00b14 removed playloop polling. Enable wakeup on LIRC socket, otherwise remote control doesn't work when paused.
* demux: make the cache refresh cached STREAM_CTRLswm42014-07-201-0/+1
| | | | | | | This fixes the same symptom as the previous commit, but when the demuxer thread is enabled. In this case, if nothing was read from the demuxer, the STREAM_CTRLs weren't updated either. To the player, this looked like the stream cache was never making progress, so playback was kept paused.
* player: don't wait forever with --cache-pause-below behaviorwm42014-07-201-0/+1
| | | | | | | Commit dc00b146, which disables polling by default, missed another instance of polling: when the player pauses automatically on low cache. This could lead to apparent freezes when playing network streams.
* build: enable compiler optimization by defaultTsukasa OMOTO2014-07-202-0/+12
|
* demux: fix a corner case (2)wm42014-07-191-2/+4
| | | | | | | | | It can happen that read_packet() doesn't read a packet, even if it succeeds. Typically this is because a packet was read, but then thrown away, because it's not part of a selected stream. The result would be a bogus EOF condition. Fix by explicitly checking for EOF.
* demux: ensure demux_read_packet_async() always readswm42014-07-191-2/+3
| | | | | | | | | | | | | In corner cases, it might be possible that a demux_read_packet_async() call fails to make the demuxer thread to read more packets. If a packet is queued, the function will simply return a packet, without marking the stream as active. As a consequence, read_packet() might decide not to read any further packets, and the demuxer will never read a packet and wake up the playback thread. This was originally done to align it with demux_read_packet() semantics; just drop this.
* demux: fix a corner casewm42014-07-191-2/+4
| | | | | | | | | | | | demux_read_any_packet() attempts to call read_packet(), but if no stream is active, it can decide not to read anything. The function will return NULL, which implies EOF. Fix this by explicitly setting demux_stream->active if needed. Also use dequeue_packet() instead of demux_read_packet(), because it's cleaner. (Shouldn't change behavior.) Possibly fixes #938.
* cocoa: don't send messages to uninitialized gl contextsStefano Pigozzi2014-07-191-1/+6
| | | | | | | This should fix some crashes where we sent makeCurrentContext to a context that was being freed from another thread. /cc @mpv-player/stable
* demux: fix opening pipes with demux_lavfwm42014-07-181-0/+5
| | | | | | | | | | | | | | | | | | | | We told the demuxer that a pipe (if stream cache is enabled) is seekable. This is because the stream cache is technically seekable, it's just that seeking may fail at runtime if a non-cached byte range is requested. This caused libavformat to issue seeks on initialization (at least when piping mp4 youtube videos). Initialization failed completely after spamming tons of error messages. So, if an unseekable stream is cached, tell the demuxer that the file is not seekable. This gets reversed later (when printing a message about caching an unseekable stream), so the user can still try his luck by issuing a seek command. The important part is that libavformat initialization will not take code paths that will unnecessarily seek for whatever reasons. CC: @mpv-player/stable: regression from 0.3.x
* video: use symbolic constants instead of magic integerswm42014-07-183-38/+43
| | | | | | | | | In my opinion this is not really necessary, since there's only a single user of update_video(), but others reading this code would probably hate me for using magic integer values instead of symbolic constants. This should be a purely cosmetic commit; any changes in behavior are bugs.
* video: don't block when reading video packetswm42014-07-183-13/+35
| | | | | | | | | | | | Instead of blocking on the demuxer when reading a packet, let packets be read asynchronously. Basically, it polls whether a packet is available, and if not, the playloop goes to sleep until the demuxer thread wakes it up. Note that the player will still block for I/O, because audio is still read synchronously. It's much harder to do the same change for audio (because of the design of the audio decoding path and especially initialization), so audio will have to be done later.
* demux: fix problems with EOFwm42014-07-181-5/+14
| | | | | | | | | | | | | | | | | | | | It was easy to get into a wakeup feedback loop on EOF. The reason that EOF is complicated is that we try to retry reading when EOF is reached, in case the EOF state actually disappears (e.g. when watching a currently downloaded file). This feature is probably worthless, since in practice you have to do a seek to "unstuck" it anyway, but since the old code also did this, we want to keep this behavior for now. Avoid the feedback loop by introducing another EOF flag (last_eof), that contains the actual previous EOF state, and is not overwritten when retrying reading. Wakeup is skipped if the EOF state didn't change. Also, actually call the wakeup callback when EOF is detected. The line that adds "ds->active = false;" actually does nothing, but in theory it's cleaner.
* demux: add function to read packets asychronouslywm42014-07-182-14/+51
|
* player: remove the last instances of pollingwm42014-07-183-38/+39
| | | | | | | | | | | | | | | | | Mouse cursor handling, --heartbeat-cmd, and OSD messages basically relied on polling. For this reason, the playloop always used a small timeout (not more than 500ms). Fix these cases, and raise the timeout to 100 seconds. There is no reason behind this number; for this specific purpose it's as close to infinity as any other number. On MS Windows, or if vo_sdl is used, the timeout remains very small. In these cases the GUI code doesn't do proper event handling in the first place, and fixing it requires much more effort. getch2_poll() still does polling, because as far as I'm aware no event- based way to detect this state change exists.
* dvd, bd: fix A/V syncwm42014-07-181-30/+29
| | | | | Slightly less robust, but simpler, and usually guarantees that audio and video are properly in sync.
* demux: fix debug log outputwm42014-07-171-1/+1
| | | | It printed the PTS instead of the DTS.
* demux: drop some unused definitionswm42014-07-172-3/+0
|
* manpage: fix documented default for --demuxer-threadwm42014-07-171-1/+1
|
* demux_lavf: reverse rotation direction with new APIwm42014-07-171-1/+1
| | | | | | | The old FFmpeg API and the new Libav API disagree about mp4 display rotation direction. Well, whatever, fix it trial-and-error-style. CC: @mpv-player/stable: add
* demux: add a demuxer threadwm42014-07-1615-303/+743
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a thread to the demuxer which reads packets asynchronously. It will do so until a configurable minimum packet queue size is reached. (See options.rst additions.) For now, the thread is disabled by default. There are some corner cases that have to be fixed, such as fixing cache behavior with webradios. Note that most interaction with the demuxer is still blocking, so if e.g. network dies, the player will still freeze. But this change will make it possible to remove most causes for freezing. Most of the new code in demux.c actually consists of weird caches to compensate for thread-safety issues (with the previously single-threaded design), or to avoid blocking by having to wait on the demuxer thread. Most of the changes in the player are due to the fact that we must not access the source stream directly. the demuxer thread already accesses it, and the stream stuff is not thread-safe. For timeline stuff (like ordered chapters), we enable the thread for the current segment only. We also clear its packet queue on seek, so that the remaining (unconsumed) readahead buffer doesn't waste memory. Keep in mind that insane subtitles (such as ASS typesetting muxed into mkv files) will practically disable the readahead, because the total queue size is considered when checking whether the minimum queue size was reached.
* tags: add copy functionwm42014-07-162-0/+14
|
* ao_lavc: Fix design of audio pts handling.Rudolf Polzer2014-07-162-3/+6
| | | | | | | | | There was confusion about what should go into audio pts calculation and what not (mainly due to the audio push thread). This has been fixed by using the playing - not written - audio pts (which properly takes into account the ao's buffer), and incrementing the samples count only by the amount of samples actually taken from the buffer (unfortunately this now forces us to keep the lock too long for my taste).
* ao_lavc: Add a missing newline for the log.Rudolf Polzer2014-07-161-1/+1
|
* ao_lavc: Fix advancing of audio pts.Rudolf Polzer2014-07-161-1/+1
|
* idet.sh: Fix a typo.Rudolf Polzer2014-07-161-1/+1
|
* osxbundle: fix detection of user librariesTsukasa OMOTO2014-07-161-4/+4
| | | | | Previous code would detect for example `libcaca.0.dylib` as a system library, because it matched the `libc` condition.
* cocoa: fix regression preventing window resizeStefano Pigozzi2014-07-151-1/+3
| | | | | I introduced this bug in b5bbb49. Sorry! This could fix #943 and #930 even though I can't reproduce those specific bugs.
* idet.sh: Fix telecine detection.Rudolf Polzer2014-07-151-5/+5
|
* Revert "Remove DVD and Bluray support"wm42014-07-1522-0/+3517
| | | | | | This reverts commit 4b93210e0c244a65ef10a566abed2ad25ecaf9a1. *shrug*
* Remove DVD and Bluray supportwm42014-07-1422-3517/+0
| | | | It never worked well. Just remux your DVD and BD images to mkv.
* demux_lavf: don't let metadata update mess up ogm playbackwm42014-07-141-1/+4
| | | | | | For OGG audio files, we usually merge the per-stream metadata back to the file-global metadata. Don't do that for OGM, because with OGM most metadata is actually per-stream.
* cocoa: fix compilation on OS X 10.8Stefano Pigozzi2014-07-143-4/+35
|
* command: don't show VO information in colorspace propertieswm42014-07-131-3/+1
| | | | | | | | | | Until now, changing the properties showed the VO colorspace parameters on OSD. This didn't work quite well, because it showed the VO parameters _before_ the change. This is because at least one video frame with the new parameters has to be shown, and this doesn't happen right after changing the property, but a bit later. Also fix a random typo in unrelated code.
* Remove some mp_msg calls with no trailing \nwm42014-07-134-47/+53
| | | | | | | The final goal is all mp_msg calls produce complete lines. We want this because otherwise, race conditions could corrupt the terminal output, and it's inconvenient for the client API too. This commit works towards this goal. There's still code that has this not fixed yet, though.
* config: adjust config parser messageswm42014-07-131-5/+4
| | | | Some cleanup. Also, try not to call mp_msg multiple times for 1 line.
* player: remove some inactive codewm42014-07-131-8/+1
| | | | | | | demux_seek() actually doesn't return seek success. Instead, it fails if the demuxer is flagged as unseekable (but this is checked explicitly at the beginning of this function), or if the seek target PTS is MP_NOPTS_VALUE (which can never happen).
* audio: drop buffered audio when switching tracks or filterswm42014-07-132-0/+2
| | | | | | | | No reason to wait until the audio has been played. This isn't a problem with gapless audio disabled, and since gapless is now default, this behavior might be perceived as regression. CC: @mpv-player/stable
* audio: don't wait for draining if pausedwm42014-07-134-15/+16
| | | | | | | | | | | | | Logic for this was missing from pull.c. For push.c it was missing if the driver didn't support it. But even if the driver supported it (such as with ao_alsa), strange behavior was observed by users. See issue #933. Always check explicitly whether the AO is in paused mode, and if so, don't drain. Possibly fixes #933. CC: @mpv-player/stable
* dvdnav: fix time display when starting in the middle of the DVDwm42014-07-131-0/+5
| | | | | | | | | | | | | | | | | | | libdvdnav can actually jump into the middle of the DVD (e.g. scene selection menus do that). Then time display is incorrect: we start from 0, even though playback time is somewhere else. This really matters when seeking. If the display time mismatches, a small relative seek will apparently jump to the beginning of the movie. Fix this by initializing the PTS stuff on opening. We have to do this after some small amount of data has been read from the stream (because libdvdnav is crap and doesn't always update the time between seeks and the first read; also see STREAM_CTRL_GET_CURRENT_TIME remarks in cache.c; although this was not observed when testing with scene selection menus). On the other hand, we want to do it before opening the demuxer, because that will read large amounts of data and likely will change the stream position. Also see commit 49813670.
* stream_dvdnav: suspend read on vts change even if the requested title is not ↵Alessandro Ghedini2014-07-131-1/+0
| | | | found
* DOCS/release-policy: mention the release version in the RELEASE_NOTES templateAlessandro Ghedini2014-07-131-1/+13
| | | | Also suggest adding changes in point releases to RELEASE_NOTES as well.
* input: skip BOM in input.confwm42014-07-121-0/+1
|
* config: skip BOMwm42014-07-121-0/+4
|
* dvd: potentially fix video aspect ratiowm42014-07-121-1/+1
| | | | | This overwrote the source stream header, instead of the stream header exported to the decoder.
* stream: don't sleep for reconnecting network if playback is stoppedwm42014-07-121-0/+2
| | | | | | Also silences the bogus message if that happens. CC: @mpv-player/stable
* cache_file: fix operation if stream size is unknownwm42014-07-121-2/+3
| | | | | | | | | | | | | Happens when playing from a pipe. Note that seeking forward doesn't work. It would be possible to create a workaround for that by reading and skipping data until the target position is reached (and writing the skipped data into the cache file), but I'm not sure about that. Fixes #928. CC: @mpv-player/stable
* osc: improve previous commitChrisK22014-07-101-6/+3
|
* osc: round displayed cache valueChrisK22014-07-101-3/+3
| | | | Fixes #919
* Revert "build: avoid defining _GNU_SOURCE"wm42014-07-102-5/+1
| | | | | | This reverts commit 2e6a8f260ca169e2e1a5646eecfc322de6f77307. Too many problems for now, such as with OSX and asprintf().
* build: include <strings.h> for strcasecmp()wm42014-07-1017-2/+18
| | | | | | | It happens to work without strings.h on glibc or with _GNU_SOURCE, but the POSIX standard requires including <strings.h>. Hopefully fixes OSX build.
* video/out: use strcmp() instead of strcasecmp() for equalizerswm42014-07-103-16/+16
| | | | This makes it more consistent with the more important VOs.
* build: deal with endian messwm42014-07-106-7/+37
| | | | | | | | | | | | | | | | | | | | There is no standard mechanism for detecting endianess. Doing it at compile time in a portable way is probably hard. Doing it properly with a configure check is probably hard too. Using the endian definitions in <sys/types.h> (usually includes <endian.h>, which is not available everywhere) works under circumstances, but the previous commit broke it on OSX. Ideally all code should be endian dependent, but that is not possible due to the dependencies (such as FFmpeg, some video output APIs, some audio output APIs). Create a header osdep/endian.h, which contains various fallbacks. Note that the last fallback uses libavutil; however, it's not clear whether AV_HAVE_BIGENDIAN is a public symbol, or whether including <libavutil/bswap.h> really makes it visible. And in fact we don't want to pollute the namespace with libavutil definitions either. Thus it's only the last fallback.
* build: avoid defining _GNU_SOURCEwm42014-07-092-1/+5
| | | | | | | | | _GNU_SOURCE defines the kitchen sink, and also prefers glibc definitions where glibc and POSIX conflict. Even though POSIX is worth less than toilet paper, we still prefer the POSIX definitions. rar.c needs asprintf(), which is _GNU_SOURCE-only. So we define _GNU_SOURCE too specifically for this file.
* DOCS/tech-overview: minor updateswm42014-07-091-12/+12
|
* demux: remove accurate_seek fieldwm42014-07-083-9/+3
| | | | It's unused now. (Only the dvd code used it until recently.)
* cocoa: simplify logic that returns used bits per colorStefano Pigozzi2014-07-081-9/+1
|
* cocoa: move CGL context creation to gl_cocoaStefano Pigozzi2014-07-083-124/+118
| | | | | | This approach is similar to what other vo_opengl backends do. It can also be used in the future to create another cocoa backend that renders offscreen with IOSurfaces or FBOs.
* demux_disc: flush slave demuxer packet queue on resyncwm42014-07-071-0/+3
| | | | | | Technically needed, but not strictly. It seems it works without in practice, because demux_lavf.c reads exactly one packet for fill_buffer call, so there are never packets queued.
* cache, dvd, bluray: simplify stream time handlingwm42014-07-072-46/+16
| | | | | | | | | | | | | | | | | | We used a complicated and approximate method to cache the stream timestamp, which is basically per-byte. (To reduce overhead, it was only cached per 8KB-block, so it was approximate.) Simplify this, and read/keep the timestamp only on discontinuities. This is when demux_disc.c actually needs the timestamp. Note that caching is currently disabled for dvdnav, but we still read the timestamp only after some data is read. libdvdread behaves well, but I don't know about libbluray, and the previous code also read the timestamp only after reading data, so try to keep it safe. Also drop the start_time offset. It wouldn't be correct anymore if used with the cache, and the idea behind it wasn't very sane either (making the player to offset the initial playback time to 0).
* input: restore ability to combine mouse buttonswm42014-07-071-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Key bindings are decided on the "down" event, so if the prefix is not unique, the first/shortest will be used (e.g. when both "a" and "a-b" are mapped, "a" will always be chosen). This also breaks combining multiple mouse buttons. But it seems users expect it to work, and it's indeed a bit strange that it shouldn't work, as mouse bindings are emitted on the key "up" event, not "down" (if the shorter binding didn't emit a command yet, why shouldn't it be combinable). Deal with this by clearing the key history when a command is actually emitted, instead of when a command is decided. This means if both MOUSE_BTN0 and MOUSE_BTN0-MOUSE_BTN1 are mapped, the sequence of holding down BTN0 and then BTN1 will redecide the current command. On the other hand, if BTN0 is released before BTN1 is pressed, the command is emitted, and the key history is deleted. So the BTN1 press will not trigger BTN0-BTN1. For normal keys, nothing should change, because commands are emitted on the "down" event already, so the key history is always cleared. Might fix #902. CC: @mpv-player/stable (if this fix is successful)
* ao_null: disable latency emulationwm42014-07-071-1/+0
| | | | | | | | | Doesn't work quite right, and will pause for the latency duration after seeking. Some users use --ao=null to disable audio (even though they should probably use --no-audio), and this use-case is broken by this issue too. CC: @mpv-player/stable
* demux: print initial metadatawm42014-07-071-0/+1
| | | | | This was accidentally broken in 7e209185, and metadata was printed only when it changed.
* osc: fix failure when using DVD menuswm42014-07-071-1/+1
| | | | [osc] Lua error: mp.assdraw:31: attempt to concatenate local 's' (a nil value)
* lua: redo error handling, print backtraceswm42014-07-071-82/+90
| | | | | | | | | | | | | | | | | | | | The original goal was just adding backtraces, however making the code safe (especially wrt. to out of memory Lua errors) was hard. So this commit also restructures error handling to make it conceptually simpler. Now all Lua code is run inside a Lua error handling, except the calls for creating and destroying the Lua context, and calling the wrapper C function in a safe way. The new error handling is actually conceptually simpler and more correct, because you can just call any Lua func