summaryrefslogtreecommitdiffstats
path: root/libao2/ao_alsa.c
Commit message (Collapse)AuthorAgeFilesLines
* Rename directories, move files (step 1 of 2) (does not compile)wm42012-11-121-868/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tis drops the silly lib prefixes, and attempts to organize the tree in a more logical way. Make the top-level directory less cluttered as well. Renames the following directories: libaf -> audio/filter libao2 -> audio/out libvo -> video/out libmpdemux -> demux Split libmpcodecs: vf* -> video/filter vd*, dec_video.* -> video/decode mp_image*, img_format*, ... -> video/ ad*, dec_audio.* -> audio/decode libaf/format.* is moved to audio/ - this is similar to how mp_image.* is located in video/. Move most top-level .c/.h files to core. (talloc.c/.h is left on top- level, because it's external.) Park some of the more annoying files in compat/. Some of these are relicts from the time mplayer used ffmpeg internals. sub/ is not split, because it's too much of a mess (subtitle code is mixed with OSD display and rendering). Maybe the organization of core is not ideal: it mixes playback core (like mplayer.c) and utility helpers (like bstr.c/h). Should the need arise, the playback core will be moved somewhere else, while core contains all helper and common code.
* ao_alsa: make code less confusingwm42012-11-011-3/+7
| | | | | | | | The call snd_pcm_hw_params_alloca(&alsa_hwparams) expands to a macro, which actually uses alloca(), and stores its result to alsa_hwparams. At the same time, alsa_hwparams was a global variable for no good reason. Make it less confusing and move the variables into the init() function, where they are needed.
* Rename to "mpv"wm42012-10-121-1/+1
| | | | | | | | | | | | | | | | | | This changes the name of this project to mpv. Most user-visible mentions of "MPlayer" and "mplayer" are changed to "mpv". The binary name and the default config file location are changed as well. The new default config file location is: ~/.mpv/ Remove etc/mplayer.desktop. Apparently this was for the MPlayer GUI, which has been removed from mplayer2 ages ago. We don't have a logo, and the MS Windows resource files sort-of require one, so leave etc/mplayer.ico/.xpm as-is. Remove the debian and rpm packaging scripts. These contained outdated dependencies and likely were more harmful than useful. (Patches which add working and well-tested packaging are welcome.)
* libaf: rename af_format.h to format.hwm42012-08-291-1/+1
| | | | | | | | | | af_format.h declares some symbols which are defined in format.c. The fact that af_format.c is a completely unrelated file is rather confusing. Having the header and implementation file use the same base name is more uniform. (af_format.c is the audio conversion filter, while af_format.h and format.c are about audio formats and their properties.) Also fix all source files which include this file.
* ao_alsa: cleanup use of vsnprintfmplayer-svn2012-08-031-1/+0
| | | | | | | | vsnprintf always 0-terminates the string, so remove extra code to do this explicitly. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34841 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar
* libmpcodecs: add ad_spdif.c, S/PDIF passthrough decodermplayer-svn2012-08-031-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | patch by Naoya OYAMA, naoya.oyama gmail com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34191 b3059339-0415-0410-9bf9-f77b7e298cf2 fix ad_spdif Call av_register_all() before initialising the SPDIF muxer. Fixes playback with -demuxer mpegts -ac spdifac3. Patch by Naoya OYAMA, naoya D oyama gmail git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34291 b3059339-0415-0410-9bf9-f77b7e298cf2 Use new API avformat_new_stream() instead of the deprecated av_new_stream(). Patch by Naoya OYAMA, naoya D oyama gmail git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34292 b3059339-0415-0410-9bf9-f77b7e298cf2 Cosmetics: Remove empty statement. Patch by Naoya OYAMA, naoya D oyama gmail git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34293 b3059339-0415-0410-9bf9-f77b7e298cf2 Use init_avformat() instead of av_register_all(). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34294 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: diego
* ao_alsa: support native mute controlwm42012-04-111-25/+46
|
* libao2: change control() types to enum, remove unused onesUoti Urpala2012-04-081-2/+0
| | | | | | | | | Change the audio driver control() command argument from "int" to "enum aocontrol". Remove unused control types (SET_DEVICE, GET_DEVICE, QUERY_FORMAT, SET_PLUGIN_DRIVER, SET_PLUGIN_LIST). The QUERY_FORMAT one looks like there's a possibility such functionality could be useful in the future, but as ao_oss was the only driver to have an actual implementation of it, the current code wasn't worth keeping.
* ao_alsa: use "Master" mixer channel instead of "PCM" by defaultwm42012-04-081-1/+1
| | | | | | | Do this, because the "Master" channel normally provides proper mute control. The old default can be forced with: --mixer-channel=PCM
* configure, ao_alsa: drop support for obsolete ALSA versionsUoti Urpala2012-02-271-21/+0
| | | | | Drop compatibility code for ALSA versions prior to 1.0.9. Change the configure check to use pkg-config only.
* ao_alsa: remove warning by simplifying error handling caseClément Bœsch2011-04-201-4/+4
| | | | | Avoid a gcc warning about potentially uninitialized variable 'err' (there was no actual problem with the code).
* spelling fixessiretart2010-11-021-1/+1
| | | | | | | | | | Found by the Debian QA tool 'lintian' git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31913 b3059339-0415-0410-9bf9-f77b7e298cf2 reintroduce typo in genres.h that was fixed fixed r31913 to match the id3v2 spec git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31920 b3059339-0415-0410-9bf9-f77b7e298cf2
* Delete things related to old translation systemUoti Urpala2010-03-101-1/+0
| | | | | Remove the help/ subdirectory, configure code to create toplevel help_mp.h, and all the '#include "help_mp.h"' lines from .c files.
* Merge svn changes up to r30463Uoti Urpala2010-03-091-1/+2
|\ | | | | | | | | | | Note that r30455 is wrong, that commit does not in fact change the default behavior as claimed in the commit message. It only breaks "-af-adv force=0", which was already pretty much useless though.
| * Explain why we still disable the ALSA resampler even though it is probablyreimar2010-01-281-1/+2
| | | | | | | | | | | | | | actually working nowadays. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30452 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30448Uoti Urpala2010-01-281-17/+6
|\|
| * Declare variable closer to where it is used.reimar2010-01-271-9/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30444 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Remove a useless global variable.reimar2010-01-271-5/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30443 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Do not needlessly make local variable static.reimar2010-01-271-3/+3
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30442 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Remove useless initializers.reimar2010-01-271-2/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30441 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Do not needlessly use (file-)global variables.reimar2010-01-271-4/+3
| | | | | | | | | | | | | | | | Since they also were initialized to a value and non-constant (changed by ALSA) this might actually have caused bugs. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30440 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30301Uoti Urpala2010-01-251-11/+11
|\|
| * Add support for distinguishing between little- and big-endian SPDIF AC3reimar2010-01-111-6/+5
| | | | | | | | | | | | | | and converting between both. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30283 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Use af_fmt2bits, it should give more sensible values than ↵reimar2010-01-111-1/+1
| | | | | | | | | | | | | | | | | | snd_pcm_format_physical_width, especially for AC3. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30279 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Add and use AF_FORMAT_IS_AC3 macro.reimar2010-01-111-4/+5
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30276 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30165Uoti Urpala2010-01-081-5/+4
|\|
| * Simplify range-checking functions for subopt parsing.reimar2010-01-011-3/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30165 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Fix function declarations to avoid casting function pointers.reimar2010-01-011-2/+3
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30164 b3059339-0415-0410-9bf9-f77b7e298cf2
* | ao_alsa: Reinitialize parameters properly when reopeningUoti Urpala2009-12-291-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | ao_alsa used static variables to define the parameter values for snd_pcm_hw_params_set_buffer_time_near() and snd_pcm_hw_params_set_periods_near(). The variables were non-const and the desired value was only set in the initializer. The ALSA functions in question take a pointer argument to an in/out parameter which is modified to reflect the value actually used. As a result, when playing multiple files or otherwise reinitializing the AO the later instances could use values that had been modified by earlier calls. Change the code to always always use the same default values.
* | Merge svn changes up to r29912Uoti Urpala2009-11-161-0/+7
|\|
| * Add support for 8 channel audio.tack2009-11-101-0/+7
| | | | | | | | | | | | | | | | Where 8 channel support is non-trivial (e.g. ao_dsound), at least ensure we fail gracefully. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29868 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r29752Uoti Urpala2009-10-061-1/+4
|\| | | | | | | | | | | | | | | | | As part of merging subtitle-in-terminal changes make update_subtitles() only clear existing subtitles if called with the reset argument, and not try to set new ones. Later calls should set the needed new subtitles, and this change avoids some problems with trying to set subtitles when mp_property_sub() in command.c gets called from initialization code before full initialization.
| * Make the ao_alsa play function always process a multiple of ao_data.outburstreimar2009-10-021-1/+4
| | | | | | | | | | | | | | | | except for the last chunk. Should fix high CPU usage reported e.g. here: http://bugs.gentoo.org/show_bug.cgi?id=286020 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29748 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r29644Uoti Urpala2009-09-041-81/+4
|\|
| * The suboption parser now takes a const options list, so mark them all const.reimar2009-09-021-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29628 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Use a buffer of about half a second, instead of sizing it to havecladisch2009-08-241-80/+3
| | | | | | | | | | | | | | a constant number of frames. This improves the behaviour at very small or large sample rates, and gets rid of lots of obsolete code. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29549 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r29532Uoti Urpala2009-08-181-0/+2
|\|
| * Do not leak the mixer handle if setting of a volume fails.cladisch2009-08-061-0/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29478 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r29455Uoti Urpala2009-07-291-2/+14
|\|
| * Replace WORDS_BIGENDIAN by HAVE_BIGENDIAN in all internal code.diego2009-07-261-2/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29443 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Use correct ALSA sample format for 24-bit samples packed in three bytes.cladisch2009-07-211-4/+4
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29434 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Handle 24bit audio formats natively by ALSA.iive2009-07-191-0/+12
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29428 b3059339-0415-0410-9bf9-f77b7e298cf2
| * whitespace cosmetics: Remove all trailing whitespace.diego2009-05-131-24/+24
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Remove trailing whitespace from most filesUoti Urpala2009-07-071-24/+24
| |
* | Translation system changes part 2: replace macros by stringsAmar Takhar2009-07-071-50/+57
| | | | | | | | | | Replace all MSGTR_ macros in the source by the corresponding English string.
* | Translation system changes part 1: wrap translated stringsAmar Takhar2009-07-071-50/+50
| | | | | | | | | | Replace mp_msg() calls which have a translated string as the format argument with mp_tmsg and add _() around all other translated strings.
* | Merge svn changes up to r28862Uoti Urpala2009-03-071-1/+1
|\|
| * Make ao_info_t structs const.reimar2009-03-061-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28858 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r28403Uoti Urpala2009-01-311-14/+28
|\|
| * 1) HAVE_SYS_ASOUNDLIB_H/HAVE_ALSA_ASOUNDLIB_H are defined to 0/1,diego2009-01-301-2/+2
| | | | | | | | | | | | | | | | not defined/undefined, use them accordingly. 2) Add ESD definitions to avoid undefined preprocessor directives warnings. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28397 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Add standard license headers.diego2009-01-261-12/+26
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28378 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r28162Uoti Urpala2008-12-191-3/+3
|\|
| * 100l, reorder check for AC3 format to avoid a possible memleakreimar2008-12-151-3/+3
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28153 b3059339-0415-0410-9bf9-f77b7e298cf2
* | ao_alsa: Sanity check get_space() return values betterUoti Urpala2008-12-101-4/+4
| | | | | | | | | | | | | | | | | | Sometimes after seek audio reset I see snd_pcm_status_get_avail() return huge values. get_space() already had a check againt the value being larger than the whole buffer; however since the unsigned value from the ALSA function had been cast to signed by that point it was interpreted as negative and the check didn't trigger. Use unsigned instead to make the check reliable and ensure the return value is sane.
* | ao_alsa: If pause loses samples replace them with silenceUoti Urpala2008-12-081-0/+13
|/ | | | | | | If the ALSA pause functionality is not available the driver has to drop buffered samples when MPlayer calls pause(). Replace them by playing a corresponding amount of silence in resume() instead of shortening the overall audio duration.
* Replace numeric constants by their defines.cehoyos2008-10-091-4/+4
| | | | | | | Fixes icc warning #188: enumerated type mixed with another type git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27738 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix "format '%d' expects type 'int', but argument 6 has type 'size_t'" warning.ranma2008-10-041-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27714 b3059339-0415-0410-9bf9-f77b7e298cf2
* Make alsa resume after suspend to disk (would say 'file descriptor is in bad ↵ranma2008-10-041-0/+4
| | | | | | state' before this change) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27712 b3059339-0415-0410-9bf9-f77b7e298cf2
* Our ALSA code needs alloca, so check for it in configure and include alloca.hreimar2008-07-171-0/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27313 b3059339-0415-0410-9bf9-f77b7e298cf2
* cosmetics: Remove pointless parentheses from return statements.diego2008-05-161-15/+15
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26789 b3059339-0415-0410-9bf9-f77b7e298cf2
* ao_alsa: Fix get_space() return values larger than buffersizeuau2007-09-241-2/+2
| | | | | | | | | | | | | | | | | After a buffer underrun the ALSA get_space() function sometimes returned values larger than the ao had set in ao_data.buffersize. Fix this by replacing the old check against MAX_OUTBURST by one against ao_data.buffersize. There should be no need for the MAX_OUTBURST check; the current MPlayer side should no longer have any constant limit on the amount of data an ao can buffer or request at once. The get_space() values larger than ao_data.buffersize triggered errors in audio decoding causing the current attempt to fill audio buffers to be aborted. I'm not sure how often that caused behavior noticeably worse then an underrun already is. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24610 b305933