aboutsummaryrefslogtreecommitdiffhomepage
Commit message (Collapse)AuthorAge
...
* command: format_bitrate: fix conversion to kbits and mbitsGravatar Marcoen Hirschberg2014-06-02
| | | | | | | Bitrates are now expressed in bits/second. This commit fixes conversions which assumed it was still in bytes/second. Signed-off-by: wm4 <wm4@nowhere>
* osc: keep track of the "fullscreen" state when it changesGravatar Marcoen Hirschberg2014-06-02
| | | | | This avoids having to poll the "fullscreen" property in the tick callback.
* wayland: remove stub for unimplemented functionGravatar wm42014-06-02
|
* osd/libass: use BorderStyle=4 for backgroundGravatar wm42014-06-01
| | | | Avoids (some) overlaps. Hopefully fixes #822.
* player: write file name to the watch later config fileGravatar Alessandro Ghedini2014-06-01
| | | | | | | | | This simply writes the file name as a comment to the top of the watch later config file. It can be useful to the user for determining whether a watch later config file can be manually removed (e.g. in case the corresponding media file has been deleted) or not.
* audio: prefer dsound over wasapiGravatar wm42014-06-01
| | | | | ao_wasapi has too many subtle failures that were reported, but there's nobody to fix them. ao_dsound seems to be more robust; so prefer it.
* demux_lavf: support new rotation metadata APIGravatar wm42014-06-01
|
* command: improve video-bitrate propertyGravatar Andrey Morozov2014-06-01
| | | | | | Signed-off-by: wm4 <wm4@nowhere> Includes some cosmetic changes over the original PR.
* vo: correctly initialize parameters in corner casesGravatar wm42014-06-01
|
* m_option: use isfinite() instead of isnormal()Gravatar wm42014-06-01
| | | | | | This accidentally rejected d==0. We can actually deal with sub-normals fine, we just want to exclude nan and infinity (although infinity is already accounted for, but anyway).
* stream: remove VCD supportGravatar wm42014-06-01
| | | | | | | | | If a single person complains, I will readd it. But I don't expect that this will happen. The main reason for removing this is that it's some of the most unclean code remaining, it's unmaintained, and I've never ever heard of someone using it.
* client API: report success status when running commandsGravatar wm42014-06-01
| | | | | | Until now, an error was reported only if the command couldn't be parsed. Attempt to do more fine-grained reporting. This is not necessarily perfect, but it's an improvement.
* command: property notification when changing af/vfGravatar wm42014-06-01
|
* command: add const to mp_notify_propertyGravatar wm42014-06-01
|
* player: hide audio/video codec and file format messagesGravatar wm42014-05-31
| | | | | None of these are very important usually. For error analysis, the plain log is useless anyway, and this information is still printed with "-v".
* gl_common: remove dlsym() fallbackGravatar wm42014-05-31
| | | | See previous commits.
* gl_wayland: remove probably unneeded workaroundGravatar wm42014-05-31
| | | | | | | | This would imply eglGetProcAddress() doesn't work correctly, but using dlsym() does. For now get rid of it - it won't work in libmpv, and we'll probably need a better workaround if it's still broken. This code was in the initial wayland commit.
* gl_x11: remove workaround for PPC OSX 10.4Gravatar wm42014-05-31
| | | | | Added in 2010 with commit 4a8486f8 (svn commit 30994). I doubt anyone still uses X11 on OSX, and we probably don't support 10.4 either.
* gl_x11: always require some GLX API functions, avoid dlsym()Gravatar wm42014-05-31
| | | | | | | | | | | | | | The functions glXGetProcAddressARB() and glXQueryExtensionsString() were loaded using dlsym(). This could fail when compiling to libmpv, because then dlopen(NULL, ...) will look in the main program's list of libraries, and the libGL linked to libmpv is never considered. (Don't know if this somehow could be worked around.) The result is that using vo_opengl with libmpv can fail. Avoid this by not using dlsym(). glXGetProcAddressARB() was already used directly in the same file, and that never caused any problems. (Still add it to the configure test.) glXQueryExtensionsString() is documented as added in GLX 1.1 - that's ancient.
* ao_alsa: make device the first sub optionGravatar wm42014-05-31
| | | | This is more convenient.
* audio/out/push: keep some extra bufferGravatar wm42014-05-31
| | | | | | | | | | | | | | | | | | | So the device buffer can be refilled quickly. Fixes dropouts in certain cases: if all data is moved from the soft buffer to the audio device buffer, the waiting code thinks it has to enter the mode in which it waits for new data from the decoder. This doesn't work, because the get_space() logic tries to keep the total buffer size down. get_space() will return 0 (or a very low value) because the device buffer is full, and the decoder can't refill the soft buffer. But this means if the AO buffer runs out, the device buffer can't be refilled from the soft buffer. I guess this mess happened because the code is trying to deal with both AOs with proper event handling, and AOs with arbitrary behavior. Unfortunately this increases latency, as the total buffered audio becomes larger. There are other ways to fix this again, but not today. Fixes #818.
* ao_alsa: reduce spurious wakeupsGravatar wm42014-05-30
| | | | | | Apparently this can happen. So actually only return from waiting if ALSA excplicitly signals that new output is available, or if we are woken up externally.
* tv: remove sysinfo() usageGravatar wm42014-05-30
| | | | | | This call was used limited the buffer size if installed RAM was below 16 MB. This stopped being useful a decade ago. The check could also overflow on 32 bit systems. Just get rid of it.
* audio/out/push: handle draining correctlyGravatar wm42014-05-30
| | | | | | | | | This did not flush remaining audio in the buffer correctly (in case an AO has an internal block size). So we have to make the audio feed thread to write the remaining audio, and wait until it's done. Checking the avoid_ao_wait variable should be enough to be sure that all data that can be written was written to the AO driver.
* audio: change handling of an EOF corner caseGravatar wm42014-05-30
| | | | | | This code handles buggy AOs (even if all AOs are bug-free, it's good for robustness). Move handling of it to the AO feed thread. Now this check doesn't require magic numbers and does exactly what's it supposed to do.
* ao_alsa: use poll() to wait for deviceGravatar wm42014-05-30
| | | | | This means the audio feed thread is woken up exactly at the time new data is needed, instead of using a time-based heuristic.
* audio/out/push: add a way to wait for the audio device with poll()Gravatar wm42014-05-30
| | | | Will be used for ALSA.
* input: separate wakeup pipe creation into a separate functionGravatar wm42014-05-30
| | | | | Error handling is slightly reduced: we assume that setting a pipe to non-blocking can never fail.
* audio/out/push: add mechanism for event-based waitingGravatar wm42014-05-30
| | | | | | | | | | | | | | | | Until now, we've always calculated a timeout based on a heuristic when to refill the audio buffers. Allow AOs to do it completely event-based by providing wait and wakeup callbacks. This also shuffles around the heuristic used for other AOs, and there is a minor possibility that behavior slightly changes in real-world cases. But in general it should be much more robust now. ao_pulse.c now makes use of event-based waiting. It already did before, but the code for time-based waiting was also involved. This commit also removes one awkward artifact of the PulseAudio API out of the generic code: the callback asking for more data can be reentrant, and thus requires a separate lock for waiting (or a recursive mutex).
* audio/out: adjust documentation commentsGravatar wm42014-05-30
|
* ring: use a different type for read/write pointersGravatar wm42014-05-30
| | | | | | uint_least32_t could be larger than uint32_t, so the return values of mp_ring_get_wpos/rpos must be adjusted. Actually just use unsigned long as type instead, because that is less awkward than uint_least32_t.
* build: disable PortAudio by defaultGravatar wm42014-05-29
| | | | | | | | | This was originally added because we thought this would make a good portable audio API, which would give us good behavior on Windows, Linux, and OSX. But this hope was disappointed: it's not reliable enough (nice deadlocks on Linux when seeking, i.e. resetting the audio device), doesn't have enough features (no channel maps, no digital passthrough), and in general just is not very good.
* audio/out/pull: remove race conditionsGravatar wm42014-05-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were subtle and minor race conditions in the pull.c code, and AOs using it (jack, portaudio, sdl, wasapi). Attempt to remove these. There was at least a race condition in the ao_reset() implementation: mp_ring_reset() was called concurrently to the audio callback. While the ringbuffer uses atomics to allow concurrent access, the reset function wasn't concurrency-safe (and can't easily be made to). Fix this by stopping the audio callback before doing a reset. After that, we can do anything without needing synchronization. The callback is resumed when resuming playback at a later point. Don't call driver->pause, and make driver->resume and driver->reset start/stop the audio callback. In the initial state, the audio callback must be disabled. JackAudio of course is different. Maybe there is no way to suspend the audio callback without "disconnecting" it (what jack_deactivate() would do), so I'm not trying my luck, and implemented a really bad hack doing active waiting until we get the audio callback into a state where it won't interfere. Once the callback goes from AO_STATE_WAIT to NONE, we can be sure that the callback doesn't access the ringbuffer or anything else anymore. Since both sched_yield() and pthread_yield() apparently are not always available, use mp_sleep_us(1) to avoid burning CPU during active waiting. The ao_jack.c change also removes a race condition: apparently we didn't initialize _all_ ao fields before starting the audio callback. In ao_wasapi.c, I'm not sure whether reset really waits for the audio callback to return. Kovensky says it's not guaranteed, so disable the reset callback - for now the behavior of ao_wasapi.c is like with ao_jack.c, and active waiting is used to deal with the audio callback.
* ring: implement drain in terms of readGravatar wm42014-05-29
| | | | | I think this makes it easier to reason about it and avoids duplicate logic.
* atomics: some corrections to __sync builtins usageGravatar wm42014-05-28
| | | | | | | | | | | | We don't need to combine __sync_add_and_fetch with a memory barrier, since these intrinsics are documented as using a full barrier already. Use __sync_fetch_and_add instead of __sync_add_and_fetch; this gives atomic_fetch_add() the correct return value (although we don't use it). Use __sync_fetch_and_add to emulate atomic_load(). This should enforce the full barrier semantics better. (This trick is stolen from the FreeBSD based stdatomic.h emulation.)
* Fix gcc 4.7 warning about shadowing talloc_parent in mp_dispact_queueGravatar Paweł Forysiuk2014-05-28
|
* ad_lavc: don't overwrite lavc bitrateGravatar Marcoen Hirschberg2014-05-28
| | | | | If the bitrate is already known in avcodec there is no need to overwrite it again with the value from sh_audio.
* vd_lavc: set video bitrate if availableGravatar Marcoen Hirschberg2014-05-28
| | | | Set the bitrate of dec_video if it is available in avcodec.
* ao_wasapi: simplify nAvgBytesPerSec calculationGravatar Marcoen Hirschberg2014-05-28
| | | | | Calculate nBlockAlign seperately to reuse in the calculation of nAvgBytesPerSec.
* af_fmt2bits: change to af_fmt2bps (bytes/sample) where appropriateGravatar Marcoen Hirschberg2014-05-28
| | | | | | In most places where af_fmt2bits is called to get the bits/sample, the result is immediately converted to bytes/sample. Avoid this by getting bytes/sample directly by introducing af_fmt2bps.
* audio: rename i_bps to 'bitrate' to avoid confusionGravatar Marcoen Hirschberg2014-05-28
| | | | Since i_bps now contains bits/sec, rename it to reflect this change.
* audio: change values from bytes-per-second to bits-per-secondGravatar Marcoen Hirschberg2014-05-28
| | | | | | | The i_bps members of the sh_audio and dev_video structs are mostly used for displaying the average audio and video bitrates. Keeping them in bits-per-second avoids truncating them to bytes-per-second and changing them back lateron.
* vaapi: fix destruction with --hwdec=haapi-copyGravatar wm42014-05-28
| | | | | | | This is incomplete; the video chain will still hold some vaapi objects after destroying the decoder and thus the vaapi context. This is very bad. Fixing it would require something like refcounting the vaapi context, but I don't really want to.
* video: warn if an emulated hwdec API is usedGravatar wm42014-05-28
| | | | | | | | | | | | | | | | mpv supports two hardware decoding APIs on Linux: vdpau and vaapi. Each of these has emulation wrappers. The wrappers are usually slower and have fewer features than their native opposites. In particular the libva vdpau driver is practically unmaintained. Check the vendor string and print a warning if emulation is detected. Checking vendor strings is a very stupid thing to do, but I find the thought of people using an emulated API for no reason worse. Also, make --hwdec=auto never use an API that is detected as emulated. This doesn't work quite right yet, because once one API is loaded, vo_opengl doesn't unload it, so no hardware decoding will be used if the first probed API (usually vdpau) is rejected. But good enough.
* vo_vaapi: cleanup error handling on initGravatar wm42014-05-28
| | | | Close the X connection if initializing vaapi fails.
* osc: correct calculation of slider positionGravatar ChrisK22014-05-28
| | | | | calculation the mouse position on the slider relied on how the hitbox is positioned, change it according to new hitbox size.
* osc: extend hitbox of seekbars to include gapGravatar ChrisK22014-05-27
| | | | | | should make usage a bit easy Fixes #810
* stream: unbreak writeable streamsGravatar wm42014-05-27
| | | | | | | | | So, basically this worked only with streams that were not local files, because stream_dvd.c "intercepts" local files to check whether they point to DVD images. This means if a stream is not writeable, we have to try the next stream implementation. Unbreaks 2-pass encoding.
* video: better handling for (very) broken timestampsGravatar wm42014-05-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes, Matroska files store monotonic PTS for h264 tracks with b-frames, which means the decoder actually returns non-monotonic PTS. Handle this with an evil trick: if DTS is missing, set it to the PTS. Then the existing logic, which deals with falling back to DTS if PTS is broken. Actually, this trick is not so evil at all, because usually, PTS has no errors, and DTS is either always set, or always unset. So this _should_ provoke no regressions (famous last words). libavformat actually does something similar: it derives DTS from PTS in ways unknown to me. The result is very broken, but it causes the DTS fallback to become active, and thus happens to work. Also, prevent the heuristic from being active if PTS is merely monotonic instead of strictly-monotonic. Non-unique PTS is broken, but we can't fallback to DTS anyway in these cases. The specific mkv file that is fixed with this commit had the following fields set: Muxing application: libebml v1.3.0 + libmatroska v1.4.1 Writing application: mkvmerge v6.7.0 ('Back to the Ground') [...] But I know that this should also fix playback of mencoder produced mkv files.
* manpage: document write_watch_later_config commandGravatar wm42014-05-27
|