summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/dec_audio.c
Commit message (Collapse)AuthorAgeFilesLines
* audio: untypedef af_streamStefano Pigozzi2012-11-021-1/+1
|
* audio: untypedef af_cfgStefano Pigozzi2012-11-021-2/+2
|
* audio: untypedef af_data and rename it to mp_audioStefano Pigozzi2012-11-021-2/+2
| | | | this is to have something specular to mp_image
* dec_audio: do not overwrite sh_audio->wf->wFormatTagwm42012-09-181-8/+2
| | | | | | | | | No decoder actually used this value (except ad_acm, which was removed a while ago), so this change shouldn't have any bad consequences. ad_ffmpeg passes wf to libavcodec decoders, but only the extra data portion. This change is needed by the next commit.
* cleanup: remove pointless #definesUoti Urpala2012-09-181-2/+0
| | | | | | | | | | | | | | | | | | | | Remove the following #defines, which should never change in practice: CONFIG_FAKE_MONO, OUTBURST, FAST_OSD, FAST_OSD_TABLE The configure script hardcoded these to particular values in config.h. They could only be changed by manually editing it. I don't think anyone would want to. X11_FULLSCREEN This once did something, but became meaningless years ago and was now always set to true if the files using it were compiled at all. Conflicts: configure libvo/osd.c libvo/vo_gl.c Merged from mplayer2. The OSD defines were already removed in this fork.
* 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.
* dec_audio: add sanity check against 0 channelsmplayer-svn2012-08-031-0/+2
| | | | | | | | Add a safeguard to avoid crash if the decoder e.g. claims 0 channels. That would be a decoder bug, but an extra check can still help. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34738 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar
* libmpcodecs: silence lines reading "AUDIO:" and "VIDEO:"wm42012-07-301-1/+1
| | | | | Both of these are not very interesting, and redundant with the corresponding VO/AO initialization messages.
* video, audio: use lavc decoders without codecs.conf entriesUoti Urpala2012-07-241-24/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for using libavcodec decoders that do not have entries in codecs.conf. This is currently only used with demux_lavf, and the codec selection is based on codec_id returned by libavformat. Also modify codec-related terminal output somewhat to make it use information from libavcodec and avoid excessively long default output. The new any-lavc-codec support is implemented with codecs.conf entries that invoke vd_ffmpeg/ad_ffmpeg without directly specifying any libavcodec codec name. In this mode, the decoders now instead select the libavcodec codec based on codec_id previously set by demux_lavf (if any). These new "generic" codecs.conf entries specify "status buggy", so that they're tried after any specific entries with higher-priority status. Add new directive "anyinput" to codecs.conf syntax. This means the entry will always match regardless of fourcc. This is used for the above new codecs.conf entries (so the driver always gets to decide whether to accept the input, and will fail init() if it can't find a suitable codec in libavcodec). Remove parsing support for the obsolete codecs.conf directive "cpuflags". This directive has not had any effect and has not been used in default codecs.conf since many years ago. Shorten codec-related terminal output. When using libavcodec decoders, show the libavcodec long_name field rather than codecs.conf "info" field as the name of the codec. Stop showing the codecs.conf entry name and "vfm/afm" name by default, as these are rarely needed; they're now in verbose output only. Show "VIDEO:" line at VO initialization rather than at demuxer open. This didn't really belong in demuxer code; the new location may show more accurate values (known after decoder has been opened) and works right if video track is changed after initial demuxer open. The vd.c changes (primarily done for terminal output changes) remove round-to-even behavior from code setting dimensions based on aspect ratio. I hope nothing depended on this; at least the even values were not consistently guaranteed anyway, as the rounding code did not run if the video file did not specify a nonzero aspect value.
* audio/video: delete buggy "dynamic plugin" codeUoti Urpala2011-10-201-44/+0
| | | | | | | | | | | | Codec selection for audio and video decoding had a "dynamic plugin" feature that tried to load a shared library for any codec that had not been enabled at compilation (disabled by default, but could be enabled with --enable-dynamic-plugins configure switch; for unknown reasons some distro packages have enabled it). The implementation was buggy and could cause normal codec selection fallback to fail if the feature was enabled. I'm not aware of any real uses of such dynamic plugins and the feature seems questionable anyway (there are no ABI guarantees that would make it safe to use). Remove the buggy feature.
* audio: move ready-for-ao data buffer from decoder to AOUoti Urpala2011-07-021-32/+26
| | | | | | | | | | | | Move the buffer storing audio data ready to be fed to the audio output driver from the audio decoder object to the AO object. This will help encoding code deal with end of input, and may also be useful to improve other general gapless audio behavior (as AOs which do not accept chunks smaller than a certain size may keep them in the buffer while the decoder changes). Less data may be dropped now when changing audio filters or switching timeline parts.
* audio: avoid duplicated error messages on init failureUoti Urpala2011-05-031-1/+3
| | | | | | | | | | | dec_audio.c init_audio_codec() would in one case print "ADecoder init failed :(\n" and return failure. Its only caller init_best_audio_codec() printed exactly the same message if the returned result was failure. Change the latter message to say "Could not open audio decoder %s.\n" instead. Some of the per-open-attempt messages are kind of value about their context; this new message should make it more clear where the attempt to open one specific codec ends.
* core: do initial A-V sync by modifying audio streamUoti Urpala2010-11-131-7/+20
| | | | | | | Add code to enforce matching pts with video when (re)starting the audio stream, by either cutting away the first samples or inserting silence at the beginning. New option -noinitial-audio-sync can be used to disable this and return to old behavior.
* libaf: add opts pointer to struct af_streamUoti Urpala2010-11-021-2/+2
|
* options: move audio_output_channels, audio_output_format to structUoti Urpala2010-11-021-2/+0
|
* audio: support parameter changes (e.g. channel count) during playbackreimar2010-11-021-4/+12
| | | | | | | | | | | | | | | | | Add support for parameter changes (e.g. channel count) during playback. This makes decoding AC3 files that switch between 2 and 6 channels work reasonably well even with -channels 6 and ffac3 decoder. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31737 b3059339-0415-0410-9bf9-f77b7e298cf2 Fix typo in error message: ACC -> AAC git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32473 b3059339-0415-0410-9bf9-f77b7e298cf2 Avoid printing AAC with SBR warning on every decode call, instead print it only after every decoder reconfiguration. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32476 b3059339-0415-0410-9bf9-f77b7e298cf2
* cleanup: Add const qualifiers for struct ad_functions pointersreimar2010-11-021-1/+1
| | | | | | | The ad_functions structs are in rodata, mark some pointers to them const. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31606 b3059339-0415-0410-9bf9-f77b7e298cf2
* Move some sh_audio field setting out of demuxer.cUoti Urpala2010-04-231-1/+4
| | | | These fields are decoder details, not information set by the demuxer.
* 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-0/+18
|\ | | | | | | | | | | 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.
| * Add missing license headers to all files in the libmpcodecs directory.diego2010-01-301-0/+18
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30463 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Move the resync-related code into more consistent places instead of having itreimar2010-01-241-0/+2
| | | | | | | | | | | | | | scattered all over the place with half of it forgotten in some places. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30420 b3059339-0415-0410-9bf9-f77b7e298cf2
* | audio: Remove fixed decode_audio() return size limit (MAX_OUTBURST)Uoti Urpala2009-12-291-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | A couple of months ago MPlayer's ALSA driver started rounding the amount of input data it was willing to accept in one call down to an integer multiple of the value it set in ao_data.outburst. In some configurations it was possible for this value to exceed the 64 KiB limit on the amount MPlayer was willing to write in a single call to the AO. As a result ao_alsa accepted 0 bytes in each play() call and audio playback failed. Fix this by removing the fixed 64 KiB limit on the amount of audio sent to AO at once; the limit was mostly a remnant of older code anyway.
* | cosmetics: Revert old dec_audio.c code uglificationUoti Urpala2009-12-281-12/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert 3 old code uglification changes that were done with the excuse of gcc-2.95 support. The last reverted change was a fix to a bug introduced in the middle change. Revert "10l, len may change after initialization time" This reverts commit ae9db277c7dae6350cab22d9c57d78cc4684aa9c. Revert "fix declaration after statement, take 2" This reverts commit 4bceedee9305e1ebf53c598eb863aac4153e67d5. Revert "fix declaration after statement" This reverts commit aef0374c1cef269d65b8783dae8d33ee45a1f976.
* | Translation system changes part 2: replace macros by stringsAmar Takhar2009-07-071-16/+16
| | | | | | | | | | Replace all MSGTR_ macros in the source by the corresponding English string.
* | Translation system changes part 1: wrap translated stringsAmar Takhar2009-07-071-16/+16
|/ | | | | Replace mp_msg() calls which have a translated string as the format argument with mp_tmsg and add _() around all other translated strings.
* Remove reference to outdated documentation file.diego2009-04-201-1/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29209 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove unnecessary malloc.h #includes and related #ifdeffery.diego2009-04-021-4/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29126 b3059339-0415-0410-9bf9-f77b7e298cf2
* Convert HAVE_MALLOC_H into a 0/1 definition, fixes the warning:diego2009-02-171-1/+1
| | | | | | | mem.c:32:5: warning: "HAVE_MALLOC_H" is not defined git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28629 b3059339-0415-0410-9bf9-f77b7e298cf2
* Use av_malloc/av_free for audio-related buffers to avoid crashes due toreimar2008-10-181-10/+4
| | | | | | | | insufficient alignment on systems without memalign. http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2008-October/058743.html git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27799 b3059339-0415-0410-9bf9-f77b7e298cf2
* Give a CONFIG_ prefix to preprocessor directives that lacked one anddiego2008-08-071-3/+3
| | | | | | | change arbitrary prefixes to CONFIG_. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27429 b3059339-0415-0410-9bf9-f77b7e298cf2
* Start unifying names of internal preprocessor directives.diego2008-07-301-1/+1
| | | | | | | | Replace all USE_ prefixes by CONFIG_ prefixes to indicate options which are configurable. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27373 b3059339-0415-0410-9bf9-f77b7e298cf2
* Try to keep decoded audio buffer aligned.reimar2008-07-141-1/+1
| | | | | | | Seems to be enough to avoid crashes (due to unaligned SSE2) with FFmpeg vorbis decoding for now. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27281 b3059339-0415-0410-9bf9-f77b7e298cf2
* typo fix: inited --> initializeddiego2008-02-141-10/+10
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25994 b3059339-0415-0410-9bf9-f77b7e298cf2
* Replace the persistent CODECS_FLAG_SELECTED by a local "stringset" withreimar2008-01-121-8/+10
| | | | | | | | | an almost-trivial implementation. This allows making the builtin codec structs const, and it also makes clearer that this "selected" status is not used outside the init functions. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25689 b3059339-0415-0410-9bf9-f77b7e298cf2
* 10l, len may change after initialization timerfelker2007-12-031-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25282 b3059339-0415-0410-9bf9-f77b7e298cf2
* fix declaration after statement, take 2rfelker2007-12-031-9/+10
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25281 b3059339-0415-0410-9bf9-f77b7e298cf2
* fix declaration after statementrfelker2007-12-031-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25280 b3059339-0415-0410-9bf9-f77b7e298cf2
* Simplify decode_audio function a bit.reimar2007-11-081-16/+12
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24989 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove a check+abort, this case should never happen anyway, and if it doesreimar2007-11-031-3/+0
| | | | | | | the most likely result is a NULL dereference which isn't much worse. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24946 b3059339-0415-0410-9bf9-f77b7e298cf2
* Simplify init_audio_filters() argumentsuau2007-11-011-14/+3
| | | | | | | | | | | | | | | Remove the following arguments as redundant: in_channels, in_format, out_minsize, out_maxsize. The first two always equal fields of the sh_audio_t struct given as the first argument to the function. The last two are unused after the allocation of sh_audio->a_out_buffer was changed to be done on demand. After the out_minsize and out_maxsize arguments are removed the function preinit_audio_filters() is identical to init_audio_filters(), so remove it and use the latter instead. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24922 b3059339-0415-0410-9bf9-f77b7e298cf2
* audio: simplify buffer allocation codeuau2007-11-011-13/+2
| | | | | | | | | Remove the code allocating sh_audio->a_out_buffer from init_audio_filters() and let the buffer be allocated by the new dynamic allocation code. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24921 b3059339-0415-0410-9bf9-f77b7e298cf2
* Change decode_audio() interfaceuau2007-11-011-73/+101
| | | | | | | | | | | | Rewrite decode_audio to better deal with filters that handle input in large blocks. It now always places output in sh_audio->a_out_buffer (which was always given as a parameter before) and reallocates the buffer if needed. After the changes filters can return arbitrarily large blocks of data without some of it being lost. The new version also allows simplifying some code. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24920 b3059339-0415-0410-9bf9-f77b7e298cf2
* Replace hopefully unreachable code with abort()uau2007-11-011-7/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24914 b3059339-0415-0410-9bf9-f77b7e298cf2
* dec_audio.c: Make some functions staticuau2007-11-011-2/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24913 b3059339-0415-0410-9bf9-f77b7e298cf2
* Simplify audio buffer allocation logicuau2007-11-011-7/+5
| | | | | | | | | Remove code that set sh_audio->a_out_buffer to equal sh_audio->a_buffer between the calls to init_best_audio_codec and init_audio_filters. Nothing uses the buffer between those calls. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24912 b3059339-0415-0410-9bf9-f77b7e298cf2
* Reindent dec_audio.cuau2007-11-011-332/+373
| | | | | | | Also remove some commented out code git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24911 b3059339-0415-0410-9bf9-f77b7e298cf2
* Clean up the way get_path is handled: Compile get_path.c to an object to linkdiego2007-08-281-2/+0
| | | | | | | | against instead of directly #including the C file and replace the many extern declarations by a proper header file. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24262 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add explicit location for headers from the libmpdemux/ directory.diego2007-03-151-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22619 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add explicit location for headers from the stream/ directory.diego2007-03-151-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22617 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix memory leak when changing playback speeduau2007-02-101-0/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22198 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix code that cuts audio data if the filters produce too much.uau2006-11-071-1/+2
| | | | | | | | It incorrectly used the channel count and sample size values from the decoder even though the filters can change those. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20768 b3059339-0415-0410-9bf9-f77b7e298cf2
* print bits/s, not bytes/sivo2006-10-061-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20093 b3059339-0415-0410-9bf9-f77b7e298cf2
* display correct audio bitrate, samplerate and number of channels onceivo2006-08-151-0/+3
| | | | | | | | they are known for mplayer -identify git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19409 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove empty function that isn't used anywhere (and never has been??).uau2006-08-141-4/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19399 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix buffer size sanity check to match what is actually required.uau2006-08-141-1/+6
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19398 b3059339-0415-0410-9bf9-f77b7e298cf2
* get_path as const, patch by Stefan Huehner, stefan AT huehner-orgreynaldo2006-07-031-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18894 b3059339-0415-0410-9bf9-f77b7e298cf2
* rm unnecesary casts from void* - part 3reynaldo2006-07-021-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18884 b3059339-0415-0410-9bf9-f77b7e298cf2
* Get ride of the several if(identify) messy lines and rearangment of some of ↵reynaldo2006-04-241-2/+1
| | | | | | the output, both patches by Kiriuja mplayer-patches AT en-directo_net, his changes are barely unrelated, nevertheless Im commiting them thogeter just for the sake of my mental healt, I had both patches already applied on my local three git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18238 b3059339-0415-0410-9bf9-f77b7e298cf2
* memalign segfaults when used without declaration on amd64 (default function ↵aurel2006-02-161-0/+4
| | | | | | return type is int so the pointer was trunctated to 32bits) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17636 b3059339-0415-0410-9bf9-f77b7e298cf2