summaryrefslogtreecommitdiffstats
path: root/audio/filter
Commit message (Collapse)AuthorAgeFilesLines
* Move compat/ and bstr/ directory contents somewhere elsewm42014-08-291-1/+1
| | | | | | | | | bstr.c doesn't really deserve its own directory, and compat had just a few files, most of which may as well be in osdep. There isn't really any justification for these extra directories, so get rid of them. The compat/libav.h was empty - just delete it. We changed our approach to API compatibility, and will likely not need it anymore.
* af_lavrresample: minor cosmeticswm42014-08-171-4/+2
|
* af_lavcac3enc: lower minimum channel number to 3wm42014-08-121-1/+1
| | | | It seems only stereo PCM should be passed through.
* af_lavcac3enc: change default bitrate to 640wm42014-08-121-1/+2
| | | | | | | No reason to use less. Since the name "default" is misleading now, replace it with "auto" (still recognize the old name).
* Improve setting AVOptionswm42014-08-022-13/+9
| | | | | | | | Use OPT_KEYVALUELIST() for all places where AVOptions are directly set from mpv command line options. This allows escaping values, better diagnostics (also no more "pal"), and somehow reduces code size. Remove the old crappy option parser (av_opts.c).
* audio: remove unused metadata fieldwm42014-07-212-3/+0
| | | | | This was used for replaygain at some point, until replaygain info was passed through explicitly.
* Remove some mp_msg calls with no trailing \nwm42014-07-131-6/+6
| | | | | | | The final goal is all mp_msg calls produce complete lines. We want this because otherwise, race conditions could corrupt the terminal output, and it's inconvenient for the client API too. This commit works towards this goal. There's still code that has this not fixed yet, though.
* af_volume: fix calculations including replay-gainMohammad Alsaleh2014-06-281-2/+2
| | | | | | | | | | | | | rgain is not an additive value. It's a multiplier/gain. Previous behaviour produced negative level values in some cases (when rgain < 1.0) which caused volume to be louder when its value was lowered. CC: @mpv-player/stable Signed-off-by: Mohammad Alsaleh <CE.Mohammad.AlSaleh@gmail.com> Signed-off-by: wm4 <wm4@nowhere>
* Add more constwm42014-06-1126-60/+60
| | | | | | | While I'm not very fond of "const", it's important for declarations (it decides whether a symbol is emitted in a read-only or read/write section). Fix all these cases, so we have writeable global data only when we really need.
* af_lavcac3enc: detach on any passthrough format, not just ac3wm42014-04-161-1/+1
|
* Kill all tabswm42014-04-1321-524/+524
| | | | | | | | | | | I hate tabs. This replaces all tabs in all source files with spaces. The only exception is old-makefile. The replacement was made by running the GNU coreutils "expand" command on every file. Since the replacement was automatic, it's possible that some formatting was destroyed (but perhaps only if it was assuming that the end of a tab does not correspond to aligning the end to multiples of 8 spaces).
* af_volume: fix clang -Wsometimes-uninitializedKevin Mitchell2014-04-131-1/+1
|
* af_lavfi: fix graph parse deprecation warningKevin Mitchell2014-04-131-1/+1
|
* demux: move metadata-based replaygain decoding out of af_volumeAlessandro Ghedini2014-04-041-80/+9
|
* af_volume: use replaygain side dataAlessandro Ghedini2014-04-041-7/+19
|
* af: add replaygain_data field to af_stream and af_instanceAlessandro Ghedini2014-04-042-0/+3
| | | | Closes #664
* af_volume: fix replaygainwm42014-03-271-2/+3
| | | | | | | | This was accidentally broken in commit b72ba3f7. I somehow made the wild assumption that replaygain adjusted the volume relative to 0% instead of 100%. The detach suboption was similarly broken.
* af_lavcac3enc: use new AVFrame APIwm42014-03-161-3/+3
|
* build: simplify libavfilter configure checkswm42014-03-161-1/+1
| | | | | This is all not needed anymore. In particular, remove all configure switches except --enable-libavfilter.
* Remove some more unneeded version checkswm42014-03-161-13/+3
| | | | | All of these check against things that happened before the latest supported FFmpeg/Libav release.
* af_lavrresample: remove avresample_set_channel_mapping() fallbackswm42014-03-161-24/+0
| | | | | | | This function is now always available. Also remove includes of reorder_ch.h from some AOs (these are just old relicts).
* af_volume: don't print missing replaygain tags as errorwm42014-03-141-1/+1
| | | | There's no reason to. Audio files often lack them.
* af_volume: add detach optionwm42014-03-141-0/+4
| | | | | | Maybe this should be default. On the other hand, this filter does something even if the volume is neutral: it clips samples against the allowed range, should the decoder or a previous filter output garbage.
* af_volume: separate softvol volume control from replaygain levelwm42014-03-141-5/+8
| | | | | | | | | Currently, both replaygain adjustment and user volume control (if softvol is enabled) share the same variable. Sharing the variable would cause especially if --volume is used; then the replaygain volume would always be overwritten. Now both gain values are simple added right before doing filtering.
* af_volume: remove double-negated suboptionwm42014-03-141-3/+3
| | | | | You had to use "no-replaygain-noclip" to set this option. Rename it, so that only one negation is needed.
* af_volume: add support for replaygain pre-amp and clipping preventionAlessandro Ghedini2014-03-131-11/+74
|
* af_volume: add replaygain supportAlessandro Ghedini2014-03-131-0/+22
| | | | | | | | | This adds the options replaygain-track and replaygain-album. If either is set, the replaygain track or album gain will be automatically read from the track metadata and the volume adjusted accordingly. This only supports reading REPLAYGAIN_(TRACK|ALBUM)_GAIN tags. Other formats like LAME's info header would probably require support from libav.
* af: add metadata field to af_stream and af_instanceAlessandro Ghedini2014-03-132-0/+3
| | | | | | This allows to propagate metadata information to audio filters. Closes #632
* af_lavfi: beat it into working with Libavwm42014-03-131-23/+39
| | | | | | | | | | | | | | | | | | | The main incompatibility was that Libav didn't have av_opt_set_int_list. But since that function is excessively ugly and idiotic (look how it handles types), I'm not missing it much. Use an aformat filter instead to handle the functionality that was indirectly provided by it. This is similar to how vf_lavfi works. The other incompatibility was channel handling. Libav consistently uses channel layouts only, why ffmpeg still requires messing with channel counts to some degree. Get rid of most channel count uses (and hope channel layouts are "exact" enough). Only in one case FFmpeg fails with a runtime check if we feed it AVFrames with channel count unset. Another issue were AVFrame accessor functions. FFmpeg introduced these for ABI compatibility with Libav. I refuse to use them, and it's not my problem if FFmpeg doesn't manage to provide a stable ABI for fields provided both by FFmpeg and Libav.
* audio/filter: remove redundant log message prefixeswm42014-01-2413-44/+44
| | | | | These are now appended automatically, so you'd get them twice before this commit.
* audio: fix balance controlwm42014-01-231-2/+2
| | | | | | | | Balance controls as used by mixer.c was broken, because af_pan.c stopped accepting its arguments. We have to allow 0 channels explicitly. Also, fix null pointer access if the matrix parameter is not used. Regression from commit 82983970.
* af: fixed out-of-bounds accesses caused by NUM_FMT and co.11rcombs2014-01-191-18/+18
| | | | | | | | | Signed-off-by: wm4 <wm4@nowhere> This merges pull request #496. The problem was that at least the initialization of the distance[] array accessed af_fmtstr_table[] entries that were out of bounds. Small cosmetic changes applied to the original pull request.
* af_export: require filename argumentwm42013-12-211-4/+3
| | | | | | Since mp_find_user_config_file() is going to get a context argument, which would be annoying to do in the audio chain (actually I'm just lazy).
* m_option, m_config: mp_msg conversionswm42013-12-211-1/+1
| | | | | | | | Always pass around mp_log contexts in the option parser code. This of course affects all users of this API as well. In stream.c, pass a mp_null_log, because we can't do it properly yet. This will be fixed later.
* audio/fmt-conversion.c: remove unknown audio format messageswm42013-12-211-0/+3
| | | | Same deal as with video/fmt-conversion.c.
* audio: mp_msg conversionswm42013-12-2118-145/+136
|
* Reduce recursive config.h inclusions in headerswm42013-12-183-3/+3
| | | | | | In my opinion, config.h inclusions should be kept to a minimum. MPlayer code really liked including config.h everywhere, though, even in often used header files. Try to reduce this.
* Remove the _ macrowm42013-12-181-0/+2
| | | | | This was a gettext-style macro to mark strings that should be translated.
* Split mpvcore/ into common/, misc/, bstr/wm42013-12-1714-15/+15
|
* Move options/config related files from mpvcore/ to options/wm42013-12-178-9/+9
| | | | | | | | | Since m_option.h and options.h are extremely often included, a lot of files have to be changed. Moving path.c/h to options/ is a bit questionable, but since this is mainly about access to config files (which are also handled in options/), it's probably ok.
* Replace mp_tmsg, mp_dbg -> mp_msg, remove mp_gtext(), remove set_osd_tmsgwm42013-12-163-6/+6
| | | | | | | | | The tmsg stuff was for the internal gettext() based translation system, which nobody ever attempted to use and thus was removed. mp_gtext() and set_osd_tmsg() were also for this. mp_dbg was once enabled in debug mode only, but since we have log level for enabling debug messages, it seems utterly useless.
* audio: flush remaining data from the filter chain on EOFwm42013-12-051-2/+2
| | | | | | | | | | | | | | | | | This can be reproduced with: mpv short.wav -af 'lavfi="aecho=0.8:0.9:5000|6800:0.3|0.25"' An audio file that is just 1-2 seconds long should play for 8-9 seconds, which audible echo towards the end. The code assumes that when playing with AF_FILTER_FLAG_EOF, the filter will either produce output, or has all remaining data flushed. I'm not really sure whether this really works if there are multiple filters with EOF handling in the chain. To handle it correctly, af_lavfi should retry filtering if 1. EOF flag is set, 2. there were input samples, and 3. no output samples were produced. But currently it seems to work well enough anyway.
* audio/filter: change filter callback signaturewm42013-12-0527-143/+144
| | | | | | | | | The new signature is actually closer to how it actually works, and someone who is not familiar to the API and how it works might make fewer fatal mistakes with the new signature than the old one. Pretty weird. Do this to sneak in a flags parameter, which will later be used to flush remaining data of at least vf_lavfi.
* af: remove af->setup fieldwm42013-12-043-9/+7
| | | | Used to be used by filters that didn't use the option parser.
* af: remove legacy option parsing hackswm42013-12-042-10/+2
|
* af_pan: change options, use option parserwm42013-12-041-42/+38
| | | | Similar to af_channels etc...
* af_ladspa: change options, use option parserwm42013-12-041-158/+103
|
* af_delay: change option parsing, fix bugs, use option parserwm42013-12-041-27/+36
| | | | Similar situation to af_channels.
* af_channels: use "unknown" channel layoutswm42013-12-041-2/+4
| | | | | | | | | This will make af_channels output a channel layout that is compatible with any destination layout. Not sure if that's a good idea though, since the way the AO choses a layout is perhaps less predictable. On the other hand, using the old MPlayer standard layouts doesn't make much sense either. We'll see whether this improves or breaks someone's use case.
* af_channels: change options, fix bugs, use option parserwm42013-12-041-65/+45
| | | | | | | Apparently this stopped working after some planar changes (broken format negotiation). Radically change option parsing in an incompatible way. Suggest alternatives to this filter, since it barely has any importance anymore.
* af_sweep: use option parserwm42013-12-041-16/+7
|
* af_surround: use option parserwm42013-12-041-24/+8
|
* af_sub: use option parserwm42013-12-041-36/+9
|
* af_sinesuppress: use option parserwm42013-12-041-24/+8
|
* af_hrtf: use option parserwm42013-12-041-34/+23
|
* af_extrastereo: use option parserwm42013-12-041-22/+8
|
* af_export: use option parserwm42013-12-041-48/+16
| | | | Probably requires the user to quote the shared buffer filename.
* af_equalizer: use option parserwm42013-12-041-26/+17
|
* af_drc: use option parserwm42013-12-041-35/+18
|
* af_center: use option parserwm42013-12-041-27/+8
|
* af: returning NULL on filtering means errorwm42013-12-041-2/+4
| | | | | | This code used to be ok, until the assert() was added. Simplify the loop statement, since the other NULL check for data doesn't make sense anymore.
* options: add options that set defaults for af/vf/ao/vowm42013-12-012-1/+2
| | | | | | | | There are some use cases for this. For example, you can use it to set defaults of automatically inserted filters (like af_lavrresample). It's also useful if you have a non-trivial VO configuration, and want to use --vo to quickly change between the drivers without repeating the whole configuration in the --vo argument.
* Use O_CLOEXEC when creating FDswm42013-11-301-1/+3
| | | | | | | | | | | | | | This is needed so that new processes (created with fork+exec) don't inherit open files, which can be important for a number of reasons. Since O_CLOEXEC is relatively new (POSIX.1-2008, before that Linux specific), we #define it to 0 in io.h to prevent compilation errors on older/crappy systems. At least this is the plan. input.c creates a pipe. For that, add a mp_set_cloexec() function (which is based on Weston's code in vo_wayland.c, but more correct). We could use pipe2() instead, but that is Linux specific. Technically, we have a race condition, but it won't matter.
* af_lavi: actually free the filter graph on uninitwm42013-11-271-5/+1
| | | | | | | This was a memory leak. Also remove the AF_CONTROL_COMMAND_LINE code, which was inactive. (It's never called if the new option parser is used.)
* audio/filter: rename af_tools.c to tools.cwm42013-11-181-0/+0
| | | | This always bothered me.
* audio: drop buffered filter data when seekingwm42013-11-184-0/+25
| | | | | This could lead to (barely) audible artifacts with --af=scaletempo and modified playback speed.
* audio/filter: remove unneeded AF_CONTROLs, convert to enumwm42013-11-1814-229/+66
| | | | | | | | The AF control commands used an elaborate and unnecessary organization for the command constants. Get rid of all that and convert the definitions to a simple enum. Also remove the control commands that were not really needed, because they were not used outside of the filters that implemented them.
* af: cleanup documentation commentswm42013-11-183-139/+22
| | | | | | And by "cleanup", I mean "remove". Actually, only remove the parts that are redundant and doxygen noise. Move useful parts to the comment above the function's implementation in the C source file.
* audio: fix mid-stream audio reconfigurationwm42013-11-181-0/+2
| | | | | | | | | | | | | | | | | | | | | Commit 22b3f522 not only redid major aspects of audio decoding, but also attempted to fix audio format change handling. Before that commit, data that was already decoded but not yet filtered was thrown away on a format change. After that commit, data was supposed to finish playing before rebuilding filters and so on. It was still buggy, though: the decoder buffer was initialized to the new format too early, triggering an assertion failure. Move the reinit call below filtering to fix this. ad_mpg123.c needs to be adjusted so that it doesn't decode new data before the format change is actually executed. Add some more assertions to af_play() (audio filtering) to make sure input data and configured format don't mismatch. This will also catch filters which don't set the format on their output data correctly. Regression due to planar_audio branch.
* af_lavrresample: set cutoff as double, not intwm42013-11-171-1/+1
| | | | Regression introduced with commit a89549e8.
* audio: drop "_NE"/"ne" suffix from audio formatswm42013-11-1519-33/+33
| | | | | | You get the native format by not appending any suffix to the format. This change includes user-facing names, e.g. for the --format option.
* af_lavcac3enc: use option parserwm42013-11-151-35/+37
| | | | | | | This changes option parsing as well as filter defaults slightly. The default is now to encode to spdif (this is way more useful than writing raw AC3 - what was this even useful for, other than writing broken ac3 -in-wav files?). The bitrate parameter is now always in kbps.
* af_lavcac3enc: use planar formatswm42013-11-121-134/