aboutsummaryrefslogtreecommitdiffhomepage
path: root/audio
Commit message (Collapse)AuthorAge
* player: change video-bitrate and audio-bitrate propertiesGravatar wm42015-04-20
| | | | | | | | | | | | | | Remove the old implementation for these properties. It was never very good, often returned very innaccurate values or just 0, and was static even if the source was variable bitrate. Replace it with the implementation of "packet-video-bitrate". Mark the "packet-..." properties as deprecated. (The effective difference is different formatting, and returning the raw value in bits instead of kilobits.) Also extend the documentation a little. It appears at least some decoders (sipr?) need the AVCodecContext.bit_rate field set, so this one is still passed through.
* af_lavrresample: fix drainingGravatar wm42015-04-18
| | | | | configure_lavrr() clears s->pending, so we have to assign it after that call.
* ao_alsa: fallback to stereo channel layout if everything else failsGravatar wm42015-04-14
| | | | | | mp_chmap_from_channels_alsa() doesn't always succeed - there are a bunch of channel counts for which no defined ALSA layout exists. Fallback to stereo in this case. (Normally, this code path shouldn't happen at all.)
* Update license headersGravatar Marcin Kurczewski2015-04-13
| | | | Signed-off-by: wm4 <wm4@nowhere>
* af_lavrresample: minor simplificationGravatar wm42015-04-12
| | | | | The in/out pointers usually have not much meaning outside of AF_CONTROL_REINIT. Also remove the redundant casts.
* af_lavrresample: allow resetting output sample formatGravatar wm42015-04-12
| | | | It must be allowed to set format==0.
* audio/filter: fully renegotiate audio formats on every reconfigGravatar wm42015-04-12
| | | | | | | | | | | | | | | | | | | It could happen that a lavrresample filter would keep its old output format when the decoder changed its output format. This simply happened because the output format was never reset. Normally, this was not an issue, because lavrresample filters only inserted for format conversion were removed on format changes. But if --no-audio-pitch-correction is set and playback speed is changed, then there is a "permanent" lavrresample filter in the filter chain, which shows this behavior. Fix by explicitly resetting output formats for all filters which support it. Note: this can crash with libswresample in some cases. I'm not sure if this is mpv's fault or libswresample's, but since it works with libavresample, I'm going to assume it's not our's.
* ao_coreaudio: fix inverted conditionGravatar wm42015-04-10
| | | | And also use the correct type for the printf call below.
* audio: automatically deatch filters if spdif prevents their useGravatar wm42015-04-07
| | | | Fixes #1743 and partially #1780.
* audio: change a detail about filter insertionGravatar wm42015-04-07
| | | | | | | | | | The af_add() function has a problem: if the inserted filter returns AF_DETACH during init, the function will have a dangling pointer. Until now this was avoided by making sure none of the used filters actually return AF_DETACH, but it's getting infeasible. Solve this by requiring passing an unique label to af_add(), which is then used instead of the pointer.
* ao_alsa: change log outputGravatar wm42015-04-07
| | | | | | | | Silence the usually user-visible warning about unsupported channel maps. This might be an ALSA bug, but ALSA will never fix this behavior anyway. (Or maybe it's a feature.) Log some other information that might be useful.
* ao_coreaudio: do not error if retrieving info for verbose mode failsGravatar wm42015-04-07
| | | | | | The message log level shouldn't get to decide whether something fails or not. So replace the fatal error check on the verbose output code path with a warning.
* ao/wasapi: use atomic state variable instead of different eventsGravatar Kevin Mitchell2015-04-04
| | | | | | | | | Unfortunately, because we have proxy objects (pAudioVolumeProxy, pEndpointVolumeProxy, pSessionControlProxy) it looks like we still have to use MsgWaitForMultipleObjects and watch for and dispatch pending messages: https://msdn.microsoft.com/en-us/library/windows/desktop/ms680112%28v=vs.85%29.aspx
* ao/wasapi: reorder priv membersGravatar Kevin Mitchell2015-04-04
|
* ao_wasapi: code formatting and alignmentGravatar Kevin Mitchell2015-04-03
|
* audio: make all format query shortcuts macrosGravatar Kevin Mitchell2015-04-03
| | | | | af_fmt_is_float and af_fmt_is_planar were previously inconsistent with AF_FORAMT_IS_SPECIAL/AF_FORMAT_IS_IEC61937
* ao_wasapi: passthrough reworkGravatar Kevin Mitchell2015-04-03
| | | | | | | | | | | | | | | * unify passthrough and pcm exclusive mode format setting/testing * set passthrough format parameters correctly * support all of mpv's existing passthrough formats * automatically test passthrough with exclusive mode and enable exclusive if it succeeds, even if it was not explictly requested. this obviates the need for --ao=wasapi,wasapi=exclusive * if passthrough fails (such as the device doesn't support the format), fallback to either exclusive pcm or shared mode depending on what the user specified. Right now this isn't very useful as it still fails due to the decoder path remainin stuck on spdif. fixes #1742
* af_lavrresample: always normalize (libswresample is stupid)Gravatar wm42015-04-02
| | | | | | | | | | libswresample doesn't normalize when remixing to a float format. This will cause clipping due to float samples being out of the allowed range. Fortunately this extremely bad default can be changed. This does not happen with libavresample: it normalizes by default. Fixes #1752.
* af: remove unused functionsGravatar wm42015-04-01
|
* ao_wasapi: abstract HRESULT_to_strGravatar Kevin Mitchell2015-04-01
|
* mixer: per-app volume and private volume conflictGravatar wm42015-04-01
| | | | | | Per-app volume would change the volume across all instances of the same application, while a private volume control (HAS_PER_APP_VOLUME) obviously should influence only one instance/audio stream only.
* ao_coreaudio: do not signal per-app volumeGravatar wm42015-04-01
| | | | | CoreAudio doesn't seem to have this concept. The volume is reset the next time audio is opened.
* mixer: handle prevention of unneeded af_volume insertion differentlyGravatar wm42015-04-01
| | | | Just so that this special-case is out of the common volume path.
* mixer: cleanup volume logic slightlyGravatar wm42015-04-01
|
* mixer: add more debug outputGravatar wm42015-04-01
| | | | For remote-debugging volume rstore problems.
* ao_wasapi: remove redundant castsGravatar Kevin Mitchell2015-03-31
|
* ao_wasapi: simplify hotplugGravatar Kevin Mitchell2015-03-31
| | | | | | | | | Take advantage of the fact that list_devs is called with a hotplug_inited ao. Also eliminate unnecessary nested function abstraction of hotplug_(un)init and list_devs. However, keep list_devs in ao_wasapi_utils.c since it uses the private functions get_device_id, get_device_name and exposing these would require including headers for IMMDevice in ao_wasapi_utils.h.
* ao_wasapi: fix device listingGravatar Kevin Mitchell2015-03-31
| | | | | remove depricated and convoluted validation. refer instead to the --audio-device option.
* ao/wasapi: add ao hotplugGravatar Kevin Mitchell2015-03-31
| | | | | | | Create a second copy of the change_notify structure for the hotplug ao. change_notify->is_hotplug distinguishes the hotplug version from the regular one monitoring the currently playing ao. Also make the change notification less verbose now that there might be two of them around.
* ad_lavc: disable AC3 DRC by defaultGravatar wm42015-03-30
|
* ao_alsa: add an option to ignore ALSA channel map negotiationGravatar wm42015-03-28
| | | | This was requested, more or less.
* ao/wasapi: use built in KSDATAFORMATsGravatar Kevin Mitchell2015-03-27
| | | | | Rather than defining them ourselves. Thanks to rossy for figuring out the headers.
* ao/wasapi: add missing "if" bracesGravatar Kevin Mitchell2015-03-26
|
* ao/wasapi: rewrite format searchGravatar Kevin Mitchell2015-03-26
| | | | | | | More clearly separate the exclusive and shared mode format discovery. Make the exclusive mode search more systematic in particular about channel maps (i.e., use chmap_sel). Assume that the same sample format / sample rates work for all channels to narrow the search space.
* ao_sndio: open device in blocking mode, don't inflate buffer artificiallyGravatar Dmitrij D. Czarkoff2015-03-26
| | | | | | The code actually uses blocking mode, so opening sound device in non-blocking mode results in choppy sound. Also, inflating the buffer isn't necessary in blocking mode, so the function may simply return without doing anything.
* mixer: fix how volume is restored with per-app system mixersGravatar wm42015-03-24
| | | | | | | | | | This broke with PulseAudio: when changing some audio filters (like for playback speed), mixer_reinit_audio() was called - and it overwrote the volume with whatever mpv thought the volume was before. If the volume was changed externally before and while mpv was running, this would reset the volume to the old value. Fixes #1335.
* ao_pulse: drop video role; fixes random mutingGravatar wm42015-03-24
| | | | | | | | | The details are described in #1173. This "features" causes problems to users so often, it's better to remove it. Fixes #1173.
* audio: remove internal libmpg123 wrapperGravatar wm42015-03-24
| | | | | | | We've been prefering the libavcodec mp3 decoder for half a year now. There is likely no benefit at all for using the libmpg123 one. It's just a maintenance burden, and tricks users into thinking it's a required dependency.
* af_bs2b: fix option default valueGravatar wm42015-03-22
| | | | | | | | | --af=bs2b:help abort()ed because the default value of the "profile" option is not represented by any choice. Fix it by adding an "unset" choice. (It's a bit odd because there's already a "default" choice, which is not default, but I don't care enough about this filter.) Fixes #1712.
* player: better handling of video with no timestampsGravatar wm42015-03-20
| | | | | | | | | | | Trying to handle such video is almost worthless, but it was requested by at least 2 users. If there are no timestamps, enable byte seeking by setting ts_resets_possible. Use the video FPS (wherever it comes from) and the audio samplerate for timing. The latter was already done by making the first packet emit DTS=0; remove this again and do it "properly" in a higher level.
* af_lavfi: handle seekingGravatar wm42015-03-17
| | | | | | | | To handle seeking correctly, we need to flush the filter. libavfilter does not support flushing, so we destroy and recreate it. We also need to handle resume-after-EOF, because the mpv audio code sends an EOF before and after seeking (the latter happens because the player drains the filter chain in a generic way, which "causes" EOF).
* ao: slightly extend debug messagesGravatar wm42015-03-16
| | | | | This function already got uglified with debug printing; might as well go all the way.
* audio: fix off by one error in channel map selection codeGravatar wm42015-03-15
| | | | | | | The consequence was that some AOs (like ao_jack) could not output 8 channels. Fixes #1688.
* ao: align audio buffer sizeGravatar wm42015-03-13
| | | | Might or might not matter.
* audio: fix spdif packet size unitGravatar wm42015-03-10
| | | | | | | | | | | In commit 5f8b060e I blindly assumed that the packet sizes were in pseudo-samples, but they were actually in bytes. Oops. (The effect was that cutting the audio was a bit less precise than it can be.) Also remove the packet size from ad_spdif.c; it didn't actually use it, and simply takes what the spdif "muxer" returns.
* audio: fix spdif DTS packet sizeGravatar wm42015-03-10
| | | | Broken in one of the previous commits.
* ad_spdif: move frame sizes to a general functionGravatar wm42015-03-10
| | | | | | Needed for the next commit. This commit should probably be reverted as soon as we're working with full audio frames internally, instead of "flat" FIFOs.
* ao_coreaudio_exclusive: port to pull API, fix latency calculationsGravatar wm42015-03-10
| | | | | | | | | | | | | | Instead of maintaining a private ring buffer, use the generic support for audio APIs with pull callbacks (internally called AO pull API). This also fixes latency calculations: instead of just returning the ringbuffer status, the audio playback state is calculated better and includes interpolation. The main reason this wasn't done earlier was mid-stream format switching. The pull API can now handle it (in a way) by destroying and recreating the AO. This is a bit brutal, but quite simple. It's untested in this new AO, though. Some details might not be right, like how ot restores the old format when reloading.
* ao_coreaudio: move some helpers to utilsGravatar wm42015-03-10
| | | | Needed by ao_coreaudio_exclusive.c in the next commit.
* ao_coreaudio_exclusive: rip out pseudo volume controlGravatar wm42015-03-10
| | | | | | | | | | | | | | | | | This could mute a digital passthrough stream by writing zeros. All other volume values did nothing. The comment about MPlayer dying hasn't been true in mpv for quite a while. It's even possible that it's fixed in upstream MPlayer. mpv will print a scary error message when trying to change volume with spdif, and continue normally. If we really want to mute by writing zeros, we should do it in a separate filter. But I'm not overly fascinated by this approach; is it even guaranteed receivers will not be confused by a stream of zeros? The main reason to remove this is that it's in the way of further cleanups.