Commit Graph

13 Commits

Author SHA1 Message Date
wm4 78128bddda Kill all tabs
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).
2014-04-13 18:03:01 +02:00
wm4 0112143fda Split mpvcore/ into common/, misc/, bstr/ 2013-12-17 02:39:45 +01:00
wm4 ed024aadb6 audio/filter: change filter callback signature
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.
2013-12-05 00:01:46 +01:00
wm4 aaccf9d5e9 af_extrastereo: use option parser 2013-12-04 23:12:51 +01:00
wm4 514c454770 audio: drop "_NE"/"ne" suffix from audio formats
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.
2013-11-15 21:25:05 +01:00
wm4 824e6550f8 audio/filter: fix mul/delay scale and values
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.)
2013-11-12 23:34:35 +01:00
wm4 d115fb3b0e af: don't require filters to allocate af_instance->data, redo buffers
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.
2013-11-12 23:27:03 +01:00
wm4 d2e7467eb2 audio/filter: prepare filter chain for non-interleaved audio
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.
2013-11-12 23:16:31 +01:00
wm4 7abc1bef40 af: replace macros with too generic names
Defining names like min, max etc. in an often used header is not really
a good idea.

Somewhat similar to MPlayer svn commit 36491, but don't use libavutil,
because that typically causes us sorrow.
2013-10-26 15:05:59 +02:00
wm4 b08617ff71 audio/filter: remove useless af_info fields
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.
2013-10-23 19:30:01 +02:00
wm4 f7a427676c audio: add some setters for mp_audio, and require filters to use them
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.
2013-05-12 21:24:54 +02:00
wm4 1e37d35970 audio/filter: remove unused AF_CONTROLs
Was unused, has never been used.
2013-05-12 20:55:50 +02:00
wm4 d4bdd0473d Rename directories, move files (step 1 of 2) (does not compile)
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.
2012-11-12 20:06:14 +01:00