summaryrefslogtreecommitdiffstats
path: root/audio/filter/af_lavcac3enc.c
Commit message (Collapse)AuthorAgeFilesLines
* 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/+82
| | | | | | | | | | | Remove the awkward planarization. It had to be done because the AC3 encoder requires planar formats, but now we support them natively. Try to simplify buffer management with mp_audio_buffer. Improve checking for buffer overflows and out of bound writes. In theory, these shouldn't happen due to AC3 fixed frame sizes, but being paranoid is better.
* af_lavcac3enc: simplify format negotiationwm42013-11-121-28/+33
| | | | | | | | | | | | | The format negotiation is the same, except don't confusingly copy the input format into af->data, just to overwrite it later. af->data should alwass contain the output format, and the existing code was just a very misguided use of the af_test_output() helper function. Just set af->data to the output format immediately, and modify the input format properly. Also, if format negotiation fails (and needs another iteration), don't initialize the libavcodec encoder.
* audio/filter: fix mul/delay scale and valueswm42013-11-121-4/+4
| | | | | | | | | | | | | Before this commit, the af_instance->mul/delay values were in bytes. Using bytes is confusing for non-interleaved audio, so switch mul to samples, and delay to seconds. For delay, seconds are more intuitive than bytes or samples, because it's used for the latency calculation. We also might want to replace the delay mechanism with real PTS tracking inside the filter chain some time in the future, and PTS will also require time-adjustments to be done in seconds. For most filters, we just remove the redundant mul=1 initialization. (Setting this used to be required, but not anymore.)
* af: don't require filters to allocate af_instance->data, redo bufferswm42013-11-121-16/+2
| | | | | | | | | | | | | Allocate af_instance->data in generic code before filter initialization. Every filter needs af->data (since it contains the output configuration), so there's no reason why every filter should allocate and free it. Remove RESIZE_LOCAL_BUFFER(), and replace it with mp_audio_realloc_min(). Interestingly, most code becomes simpler, because the new function takes the size in samples, and not in bytes. There are larger change in af_scaletempo.c and af_lavcac3enc.c, because these had copied and modified versions of the RESIZE_LOCAL_BUFFER macro/function.
* audio/filter: prepare filter chain for non-interleaved audiowm42013-11-121-15/+15
| | | | | | | | | | | | | | | | | | Based on earlier work by Stefano Pigozzi. There are 2 changes: 1. Instead of mp_audio.audio, mp_audio.planes[0] must be used. 2. mp_audio.len used to contain the size of the audio in bytes. Now mp_audio.samples must be used. (Where 1 sample is the smallest unit of audio that covers all channels.) Also, some filters need changes to reject non-interleaved formats properly. Nothing uses the non-interleaved features yet, but this is needed so that things don't just break when doing so.
* audio: replace af_fmt2str_short -> af_fmt_to_strwm42013-11-071-2/+1
| | | | Also, remove all af_fmt2str usages.
* audio/filter: remove useless af_info fieldswm42013-10-231-6/+3
| | | | | | | Drop the author and comment fields. They were completely unused - not even printed in verbose mode, just dead weight. Also use designated initializers and drop redundant flags.
* Fix some -Wshadow warningswm42013-07-231-3/+3
| | | | | | In general, this warning can hint to actual bugs. We don't enable it yet, because it would conflict with some unmerged code, and we should check with clang too (this commit was done by testing with gcc).
* reorder_ch: remove old channel reorder functionswm42013-05-121-9/+0
| | | | | | | 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.
* af: use mp_chmap for mp_audio, include channel map in format negotiationwm42013-05-121-3/+3
| | | | | 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 themwm42013-05-121-9/+7
| | | | | | | | | | | | | | | | 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.
* af_lavcac3enc: switch to avcodec_encode_audio2()wm42013-03-131-45/+71
| | | | | | | | avcodec_encode_audio() was deprecated, and was finally removed from Libav and FFmpeg git. This appears to work. I get heavy A/V desync with -ao alsa and -ao pcm, but this was already so before this change.
* af_lavcac3enc, encode: support planar formatsRudolf Polzer2012-12-031-3/+44
| | | | | | | This fixes operation with current ffmpeg releases. Note that this planarization is slow and should be reverted once proper planar audio support is there in mpv.
* Rename directories, move files (step 2 of 2)wm42012-11-121-1/+1
| | | | | | | | | | | | Finish renaming directories and moving files. Adjust all include statements to make the previous commit compile. The two commits are separate, because git is bad at tracking renames and content changes at the same time. Also take this as an opportunity to remove the separation between "common" and "mplayer" sources in the Makefile. ("common" used to be shared between mplayer and mencoder.)
* Rename directories, move files (step 1 of 2) (does not compile)wm42012-11-121-0/+332
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.