aboutsummaryrefslogtreecommitdiffhomepage
Commit message (Collapse)AuthorAge
* Merge branch 'audio_changes'Gravatar wm42013-05-12
|\ | | | | | | | | Conflicts: audio/out/ao_lavc.c
| * af: improve filter chain setup retry limitGravatar wm42013-05-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | af_reinit() is responsible for inserting automatic conversion filters for channel remixing, format conversion, and resampling. We don't require that a single filter can do all these (even though af_lavrresample does nearly all of this, sometimes af_format has to be used instead for format conversions). This makes setting up the chain more complicated, and a way is needed to prevent endless appending of conversion filters if a conversion is not possible. Until now, this used a stupidly simple yet robust static retry limit to detect failure. This is perfectly fine, and the limit (20) was good enough to handle about ~5 filters. But with more filters, and if each filter requires 3 additional conversion filters, this would fail. So raise the limit to 4 retries per filter. This is still stupidly simple and robust, but won't arbitrarily fail if the filter count is too large.
| * audio: add double sample formatGravatar wm42013-05-12
| | | | | | | | | | | | To make this easier, get rid of the direct mapping of the AF_FORMAT_BITS_MASK bit field to number of bytes. This way we can throw away the unused AF_FORMAT_48BIT and don't have to add ..._56BIT.
| * ao_alsa: set fallback if format unknownGravatar wm42013-05-12
| | | | | | | | | | | | The snd_pcm_hw_params_test_format() call actually crashes in alsa-lib if called with SND_PCM_FORMAT_UNKNOWN, so the already existing fallback code won't work in this case.
| * audio/out: channel map selectionGravatar wm42013-05-12
| | | | | | | | | | | | | | | | | | Make all AOs use what has been introduced in the previous commit. Note that even AOs which can handle all possible layouts (like ao_null) use the new functions. This might be important if in the future ao_select_champ() possibly honors global user options about downmixing and so on.
| * audio: add channel map selection functionGravatar wm42013-05-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The point is selecting a minimal fallback. The AOs will call this through the AO API, so it will be possible to add options affecting the general channel layout selection. It provides the following mechanism to AOs: - forcing the correct channel order - downmixing to stereo if no layout is available - allow 5.1 <-> 5.1(side) fallback - handling "unknown" channel layouts This is quite weak and lots of code/complexity for little gain. All AOs already made sure the channel order was correct, and the fallback is of little value, and could perhaps be done in the frontend instead, like stereo downmixing with --channels=2 is handled. But I'm not really sure how this stuff should _really_ work, and the new code will hopefully provides enough flexibility to make radical changes to channel layout negotiation easier.
| * ao_pulse: move format setup codeGravatar wm42013-05-12
| |
| * af_lavrresample: avoid channel reordering with unknown layoutsGravatar wm42013-05-12
| | | | | | | | | | | | | | If one of the input or output is an unknown layout, but the other is known, it can still happen that channels are remixed randomly. Avoid this by forcing default layouts in this case. (Doesn't work if the channel counts are different.)
| * manpage: update --channelsGravatar wm42013-05-12
| |
| * ao_openal: use channel map instead of ALSA fixed layoutGravatar wm42013-05-12
| | | | | | | | | | | | | | | | | | Now mpv's channel map is used to map each channel to a speaker. This allows in theory for playback of any layout for which ao_openal actually has a speaker defined. Also add the back-center (BC) speaker, which allows playback of 6.0 audio. Enabling more layouts by adding other speakers would be possible, but I'm not sure about the speaker positions.
| * audio/filters: add af_forceGravatar wm42013-05-12
| | | | | | | | | | Its main purpose is for testing in case channel layout stuff breaks, in particular in connection with old audio filters.
| * ao: remove ao_driver.is_new fieldGravatar wm42013-05-12
| | | | | | | | Is unused, is completely pointless.
| * ao_alsa: remove global variablesGravatar wm42013-05-12
| |
| * ao_alsa: switch to new AO APIGravatar wm42013-05-12
| |
| * af_ladspa: code cleanupGravatar eng2013-05-12
| | | | | | | | | | | | Cleanup based on results from cppcheck-1.59 Reduce the scope of several variables Fix memory leak
| * audio: print channel map additionally to channel count on terminalGravatar wm42013-05-12
| |
| * ao_alsa: map to exact channel layoutGravatar wm42013-05-12
| | | | | | | | | | | | | | This allows supporting 5 channel audio (which can be eother 5.0 or 4.1). Fallback doesn't work yet. It will do nonsense if the channel layout doesn't match perfectly, even though it's similar.
| * ao_alsa: move format lookup into separate functionGravatar wm42013-05-12
| |
| * ao_alsa: more reformatGravatar wm42013-05-12
| |
| * af: print filter chain info on errorGravatar wm42013-05-12
| | | | | | | | | | The filter chain was only visible with -v. Always print it if the filter chain could not be configured.
| * ao_alsa: cosmetics, macro-fy error reportingGravatar wm42013-05-12
| | | | | | | | | | | | | | | | Add a CHECK_ALSA_ERROR macro to report ALSA errors. This is similar to what vo_vdpau does. This removes lots of boiler plate, it almost gives me the feeling the ao_alsa initialization code is now readable. This change is squashed with the reformatting, because both changes are just as noisy and useless.
| * ao_alsa: uncrustifyGravatar wm42013-05-12
| |
| * uncrustify: add some instructionsGravatar wm42013-05-12
| |
| * audio: remove useless audio channels from AO, unless requestedGravatar wm42013-05-12
| |
| * ad_lavc: force channel layout pass-through with demux_rawaudioGravatar wm42013-05-12
| | | | | | | | | | | | | | | | Using demux_rawaudio and the --rawaudio-channels option is useful for testing channel map stuff. The libavcodec PCM decoder normalizes the channel map to ffmpeg order, though. Prevent this by forcing the original channel map when using the mp-pcm pseudo decoder entry (used by demux_rawaudio and stream/tv.c only).
| * ao_coreaudio: switch to WAVEEXT channel orderGravatar wm42013-05-12
| | | | | | | | | | This used ALSA order, which was not correct. Most likely this has been wrong since forever.
| * ao_pulse: try to set correct channel layoutGravatar wm42013-05-12
| | | | | | | | | | | | | | | | | | | | | | | | Like most other AOs, ao_pulse set the channel count only, always using a default layout. Try to set the exact layout. For this, we need a big lookup table to map waveex/lavc/mpv speaker position to PulseAudio's, since PA_CHANNEL_POSITION_ is apparently not compatible to waveext, and I haven't seen any API functions that would help mapping them. Completely untested. (Let's leave that to someone else...)
| * core: use channel map on demuxer level tooGravatar wm42013-05-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This helps passing the channel layout correctly from decoder to audio filter chain. (Because that part "reuses" the demuxer level codec parameters, which is very disgusting.) Note that ffmpeg stuff already passed the channel layout via mp_copy_lav_codec_headers(). So other than easier dealing with the demuxer/decoder parameters mess, there's no real advantage to doing this. Make the --channels option accept a channel map. Since simple numbers map to standard layouts with the given number of channels, this is downwards compatible. Likewise for demux_rawaudio.
| * reorder_ch: remove old channel reorder functionsGravatar wm42013-05-12
| | | | | | | | | | | | | | This is done in af_lavrresample now, and as part of format negotiation. Also remove the remaining reorder_channel calls. They were redundant and did nothing.
| * audio: let libavresample do channel reorderingGravatar wm42013-05-12
| |
| * af_lavrresample: context is always allocated hereGravatar wm42013-05-12
| |
| * audio/out: switch to channel mapGravatar wm42013-05-12
| | | | | | | | | | | | This actually breaks audio for 5/6/8 channels. There's no reordering done yet. The actual reordering will be done inside of af_lavrresample and has to be made part of the format negotiation.
| * af_pan: set unknown channel layout for outputGravatar wm42013-05-12
| |
| * af: use mp_chmap for mp_audio, include channel map in format negotiationGravatar wm42013-05-12
| | | | | | | | | | Now af_lavrresample pretends to reorder the channels, although it doesn't yet, and nothing sets non-standard layouts either.
| * audio: add some setters for mp_audio, and require filters to use themGravatar wm42013-05-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mp_audio has some redundant fields. Setters like mp_audio_set_format() initialize these properly. Also move the mp_audio struct to a the file audio.c. We can remove a mysterious line of code from af.c: in.format |= af_bits2fmt(in.bps * 8); I'm not sure if this was ever actually needed, or if it was some kind of "make it work" quick-fix that works against the way things were supposed to work. All filters etc. now set the format correctly, so if there ever was a need for this code, it's definitely gone.
| * audio: add channel map APIGravatar wm42013-05-12
| | | | | | | | | | | | | | Unused, will be used in the following commits. Let chmap.h define the number of maximum channels, because that is most convenient.
| * audio/filter: remove unused AF_CONTROLsGravatar wm42013-05-12
| | | | | | | | Was unused, has never been used.
* | macosx_application: fix crash when quitting playerGravatar Stefano Pigozzi2013-05-12
| | | | | | | | | | | | | | | | | | mpv crashed on quit when it was run using the bundle functionality and started without any files thus waiting for file open events. In that case, since there is no key_fifo initialized yet, short circuit to `terminate_cocoa_application()` which is generally called from `exit_player()` during normal lifecycle. Fixes bug report from user `eng` on IRC.
* | man: fix spelling errorGravatar Stefano Pigozzi2013-05-12
| | | | | | | | Thanks @kastaren for spotting this.
* | cocoa_common: add native OSX fullscreen supportGravatar Stefano Pigozzi2013-05-12
| | | | | | | | | | | | | | | | This adds Mission Control fullscreen functionality to mpv. Since this doesn't play well with many of mpv's features disable it by default. Users can activate this feature by using `--native-fs` when starting mpv. Fixes #34
* | macosx_application: add menu item for hide operationGravatar Stefano Pigozzi2013-05-12
| | | | | | | | Fixes #35
* | OSX: run native event loop in a separate threadGravatar Stefano Pigozzi2013-05-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is a followup on the previous one and uses a solution I like more since it totally decouples the Cocoa code from mpv's core and tries to emulate a generic Cocoa application's lifecycle as much as possible without fighting the framework. mpv's main is executed in a pthread while the main thread runs the native cocoa event loop. All of the thread safety is mainly accomplished with additional logic in cocoa_common as to not increase complexity on the crossplatform parts of the code.
* | OSX: use native Cocoa's event loopGravatar Stefano Pigozzi2013-05-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Schedule mpv's playloop as a high frequency timer inside the main Cocoa event loop. This has the benefit to allow accessing menus as well as resizing the window without the playback being blocked and allows to remove countless hacks from the code that involved manually pumping the event loop as well simulating manually some of the Cocoa default behaviours. A huge improvement consists in removing NSApplicationLoad. This is a C function defined in the Cocoa header and implements a minimal OSX application under ther hood so that you can use the Cocoa GUI toolkit from C/C++ without having to respect the Cocoa standards in terms of application initialization. This was bad because the behaviour implemented by NSApplicationLoad was hard to customize and had several gotchas especially in the menu department. mpv was changed to be just a nib-less application. All the Cocoa part is still generated in code but the event handling is now not dissimilar to what is present in a stock Mac application. As a part of reviewing the initialization process, I also removed all of `osdep/macosx_finder_args`. The useful parts of the code were moved to `osdep/macosx_appication` which has the broaded responsibility of managing the full lifecycle of the Cocoa application. By consequence the `--enable-macosx-finder` configure switch was killed as well, as this feature is always enabled. Another change the users will notice is that when using a bundle the `--quiet` option will be inserted much earlier in the initializaion process. This results in mpv not spamming mpv.log anymore with all the initialization outputs.
* | add a way to resize window contents without VO resizeGravatar wm42013-05-12
| | | | | | | | | | | | | | | | | | gl_video_resize_redraw() simply resizes and redraws (but without invoking swapGlBuffers()). The VO is not involved in any way, so this can simply be called from inside the mpgl lock from any thread. Requires a minor refactor of the GL OSD code in order to redraw without an OSD object.
* | vo_opengl: lock OpenGL contextGravatar wm42013-05-12
| | | | | | | | | | | | | | | | | | | | To simplify things, we just assume that all OpenGL calls as well as all calls into gl_video must be locked. Currently, also assume that anything GUI related must be locked as well (stuff like VOCTRL_BORDER). In its current state, this commit does nothing, but it will allow us to move the Cocoa GUI out of the playloop, as well as possibly implementing better framedropping.
* | gl_common: add some sort of locking APIGravatar wm42013-05-12
| | | | | | | | | | | | | | | | | | Some OpenGL implementations on some platforms require that a context is current only on one thread. For this reason, mpgl_lock() and mpgl_unlock() take care of this as well for convenience. Each backend that needs thread safety should provide it's own locking strategy inside of `set_current`.
* | demux: fix big endian PCM in mkv with demux_mkvGravatar wm42013-05-11
| |
* | For now, disable autodetection of sdl/sdl2Gravatar Rudolf Polzer2013-05-11
| | | | | | | | | | | | | | | | This is done because statically linked SDL libraries are incompatible with direct X11 function use (e.g. vo_x11, vo_gl etc.) because of clashing symbol names. http://bugzilla.libsdl.org/show_bug.cgi?id=1828
* | command: add time-remaining propertyGravatar wm42013-05-10
| |
* | stream_bluray: report chapter timesGravatar wm42013-05-09
| | | | | | | | This was forgotten in commit 7294303.