Commit Graph

220 Commits

Author SHA1 Message Date
wm4 f2660c0a29 af_volume: uncrustify
Also, use more C99 and remove "register" keywords.
2013-10-26 13:36:46 +02:00
wm4 b890093c44 af_volume: don't change volume if nothing is to be changed
On the float path. Note that this skips clipping, but we expect that
everything on the audio-path is pre-clipped anyway.
2013-10-26 13:36:34 +02:00
wm4 3b5657f0c1 af_volume: remove unused features
Roughly follows MPlayer svn commits 36492 and 36493. We also remove
the volume peak reporting. (There are much better libavfilter filters
for this, I think.)
2013-10-26 13:36:34 +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 a46453347f af_force: set format early for better debug output
Set the input/output format in filter init. This doesn't change anything
functionally, but it makes the forced format show up in the filter chain
init verbose output (which sometimes prints the filter chain before all
filters have been configured).
2013-10-23 19:30:01 +02:00
wm4 247c89d6ba af_force: minor simplifications 2013-10-23 19:30:01 +02:00
wm4 943c785619 audio/filter: rename af_force.c to af_format.c
The filter itself was already renamed earlier - but rename the file too.
2013-10-23 19:29:30 +02:00
wm4 e60b8f181d audio/filter: split af_format into separate filters, rename af_force
af_format is the old audio conversion filter. It could do all possible
conversions supported by the audio chain. However, ever since the
addition of af_lavrresample, most conversions are done by
libav/swresample, and af_format is used as fallback.

Separate out the fallback cases and remove af_format. af_convert24 does
24 bit <-> 32 bit conversions, while af_convertsignendian does sign and
endian conversions. Maybe the way the conversions are split sounds a bit
odd. But the former changes the size of the audio data, while the latter
is fully in-place, so there's at least different buffer management.

This requires a quite complicated algorithm to make sure all these
"partial" conversion filters can actually get from one format to
another. E.g. s24le->s32be always requires convertsignendian and
convert24, but af.c has no idea what the intermediate format should
be. So I added a graph search (trying every possible format and
filter) to determine required format and filter. When I wrote this,
it seemed this was still better than messing everything into
af_lavrresample, but maybe this is overkill and I'll change my
opinion. For now, it seems nice to get rid of af_format though.

The AC3->IEC61937 conversion isn't supported anymore, but I don't think
this is needed anywhere. Most AOs test all formats explicitly, or use
the AF_FORMAT_IS_IEC61937() macro (which includes AC3).

One positive consequence of this change is that conversions always
include dithering (done by libav/swresample), instead of possibly going
through af_format, which doesn't do anything fancy.

Rename af_force to af_format. It's essentially compatible with command
line uses of af_format. We retain a compatibility alias for af_force.
2013-10-23 10:04:12 +02:00
wm4 c01feaaa79 af_lavrresample: actually free resampler
Fixes #304.
2013-10-19 13:19:35 +02:00
wm4 542086dd45 af: merge af_reinit() and fix_output_format()
Calling them separately doesn't really make sense, and all existing
calls to them usually combined them. One subtitle difference was that
af_init() didn't wipe the filter chain if initialization of the chain
itself failed, but that didn't really make sense anyway.

Also remove af_init() from the code for setting balance in mixer.c. The
mixer should be in the initialized state only if audio is fully
initialized, so the af_init() call made no sense.

Note that the filter "editing" code in command.c doesn't really do a
nice job of handling errors in case recreating an _old_ (known to work)
filter chain unexpectedly fails, and this obscure/rare case might be
differently handled after this change.
2013-09-20 13:43:00 +02:00
wm4 4ba52a9e82 mixer, af_volume: use linear values instead of dB
Softvol always used a linear multiplier for volume control. This was
converted to dB, and then back to linear in af_volume. Remove this non-
sense. We still try to keep the command line argument to af_volume in
dB, though.
2013-09-19 14:31:55 +02:00
wm4 69e272dad7 af_export: fix compilation warning
Blargh.
2013-09-19 14:30:53 +02:00
wm4 5249cccfcf Config path functions can return NULL
It's quite unlikely, but functions like mp_find_user_config_file() can
return NULL, e.g. if $HOME is unset.

Fix all the code that didn't check for this correctly yet.
2013-09-18 19:56:15 +02:00
wm4 53b5227270 audio: make internal audio format 0 an invalid format
Having to use -1 for that is generally quite annoying.

Audio formats are created from bitmasks, and it can't be excluded that
0 is not a valid format. Fix this by adjusting AF_FORMAT_I so that it
is never 0. Along with AF_FORMAT_F and the special formats, all valid
formats are covered and guaranteed to be non-0.

It's possible that this commit will cause some regressions, as the
check for invalid audio formats changes a bit.
2013-08-26 10:09:41 +02:00
Stefano Pigozzi 406241005e core: move contents to mpvcore (2/2)
Followup commit. Fixes all the files references.
2013-08-06 22:52:31 +02:00
wm4 ee2e3b3374 core: change speed option/property to double
The --speed option and the speed property used float. Change them to
double.

Change the commands that manipulate the property (speed_mult/add) to
double as well. Since the cycle command shares code with the add
command, we change that as well.

The reason for this change is that this allows better control over
speed, such as stepping by semitones. Using floats is also just plain
unnecessary.
2013-08-05 00:00:26 +02:00
wm4 e83cbde1a4 Fix some -Wshadow warnings
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).
2013-07-23 00:45:23 +02:00
wm4 78ebb3c6fa options: make legacy hacks for AFs/VFs more explicit
This means that AOs/VOs with no options set do not take the legacy
option parsing path, but instead report that they have no options.
2013-07-22 23:07:23 +02:00
wm4 c729df3d10 af_bs2b: use new option API 2013-07-22 15:11:04 +02:00
wm4 74146a855c af_lavfi: switch to new option API
This makes it actually possible to use the filter with more complicated
filter graphs (such as graphs containing the "," character).
2013-07-22 15:11:04 +02:00
wm4 465b162d13 af_scaletempo: use new option API 2013-07-22 15:11:04 +02:00
wm4 7c2bf06615 af_lavrresample: switch to new option API
Also add a "o" suboption, which should allow fine control over
libavresample.
2013-07-22 15:11:04 +02:00
wm4 1189f64dd1 af_force: use new option API 2013-07-22 15:11:04 +02:00
wm4 3b8dfddb4c audio/filter: use new option API
Make the VF/VO/AO option parser available to audio filters. No audio
filter uses this yet, but it's still a quite intrusive change.

In particular, the commands for manipulating filters at runtime
completely change. We delete the old code, and use the same
infrastructure as for video filters. (This forces complete
reinitialization of the filter chain, which hopefully isn't a problem
for any use cases. The old code forced reinitialization too, but it
could potentially allow a filter to cache things; e.g. consider loaded
ladspa plugins and such.)
2013-07-22 15:11:03 +02:00
wm4 221ef23d0d af_force: add option that causes filter to fail at initialization
This is useful for debugging.
2013-07-22 15:06:43 +02:00
wm4 0c9b0ba40d af: fix recovery code for filter insertion (changing volume with spdif crash)
This code is supposed to run if dynamic filter insertion (such as when
inserting a volume filter in mixer.c) fails. Then it removes all filters
and recreates the default list of filters. But the code just blew up and
entered an endless loop, because it removed even the sentinel in/out
filters. This could happen when trying to use softvol controls while
using spdif, but also other situations. Fix it by calling the correct
code.

Also remove these obnoxious yoda-conditions.
2013-07-22 15:06:07 +02:00
wm4 60a7f3b8bc af_lavfi: add libavfilter bridge
Mostly copied from vf_lavfi. The parts that could be shared are minor,
because most code is about setting up audio and video, which are too
different.

This won't work with Libav. I used ffplay.c as guide, and noticed too
late that their setup methods are incompatible with Libav's. Trying to
make it work with both would be too much effort. The configure test for
av_opt_set_int_list() should disable af_lavfi gracefully when compiling
with Libav.

Due to option parser chaos, you currently can't have a "," as part of
the filter graph string - not even with quoting or escaping. This will
probably be fixed later.

The audio filter chain is not PTS aware. So we have to do some hacks
to make up a fake PTS, and we have to map the output PTS back to the
filter chain's method of tracking PTS changes and buffering, by
adjusting af->delay.
2013-05-23 17:44:06 +02:00
wm4 636e1edd9e af_lavrresample: fix inverted condition
This was added with the previous commit. It likely broke some obscure
special-cases, which (hopefully) do not happen with normal playback.
2013-05-13 18:05:37 +02:00
wm4 279f4b59dc audio: fix compilation with older libavresample versions
The libavresample version of the current Libav stable release lacks the
avresample_set_channel_mapping() function. (FFmpeg's libswresample seems
to be fine, because they added swr_set_channel_mapping() first.)

Add a cheap/slow workaround to do channel reordering on our own. We
don't use the recently removed MPlayer code (see commit 586b75a),
because that is not generic enough.

The functionality should be the same as with full-featured
libavresample, and any differences are bugs. It's probably slower,
though.
2013-05-13 00:39:07 +02:00
wm4 48f9431151 af: improve filter chain setup retry limit
af_reinit() is responsible for inserting automatic conversion filters
for channel remixing, format conversion, and resampling. We don't
require that a single filter can do all these (even though
af_lavrresample does nearly all of this, sometimes af_format has to be
used instead for format conversions). This makes setting up the chain
more complicated, and a way is needed to prevent endless appending of
conversion filters if a conversion is not possible.

Until now, this used a stupidly simple yet robust static retry limit to
detect failure. This is perfectly fine, and the limit (20) was good
enough to handle about ~5 filters. But with more filters, and if each
filter requires 3 additional conversion filters, this would fail. So
raise the limit to 4 retries per filter. This is still stupidly simple
and robust, but won't arbitrarily fail if the filter count is too large.
2013-05-12 21:45:05 +02:00
wm4 5c0c141a55 af_lavrresample: avoid channel reordering with unknown layouts
If one of the input or output is an unknown layout, but the other is
known, it can still happen that channels are remixed randomly. Avoid
this by forcing default layouts in this case. (Doesn't work if the
channel counts are different.)
2013-05-12 21:24:56 +02:00
wm4 d9582ad0a4 audio/filters: add af_force
Its main purpose is for testing in case channel layout stuff breaks, in
particular in connection with old audio filters.
2013-05-12 21:24:56 +02:00
eng 74487b8430 af_ladspa: code cleanup
Cleanup based on results from cppcheck-1.59
Reduce the scope of several variables
Fix memory leak
2013-05-12 21:24:56 +02:00
wm4 3b1956608d audio: print channel map additionally to channel count on terminal 2013-05-12 21:24:56 +02:00
wm4 9afad5180c af: print filter chain info on error
The filter chain was only visible with -v. Always print it if the filter
chain could not be configured.
2013-05-12 21:24:56 +02:00
wm4 586b75ad08 reorder_ch: remove old channel reorder functions
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.
2013-05-12 21:24:55 +02:00
wm4 408b7eecee audio: let libavresample do channel reordering 2013-05-12 21:24:55 +02:00
wm4 b20026c29b af_lavrresample: context is always allocated here 2013-05-12 21:24:55 +02:00
wm4 37325f2796 af_pan: set unknown channel layout for output 2013-05-12 21:24:54 +02:00
wm4 7971bb87cb af: use mp_chmap for mp_audio, include channel map in format negotiation
Now af_lavrresample pretends to reorder the channels, although it
doesn't yet, and nothing sets non-standard layouts either.
2013-05-12 21:24:54 +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 0042735d7a audio: add channel map API
Unused, will be used in the following commits.

Let chmap.h define the number of maximum channels, because that is most
convenient.
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 0d939a6847 af: fix negotiation endless loop
Yeah... ok.

Can be reproduced by having AF_CONTROL_CHANNELS not really set the
correct channel map.
2013-04-13 04:21:29 +02:00
wm4 fd6302631a af: streamline format negotiation
Add dummy input and output filters to remove special cases in the format
negotiation code (af_fix_format_conversion() etc.). The output of the
filter chain is now negotiated in exactly the same way as normal
filters.

Negotiate setting the sample rate in the same way as other audio
parameters. As a side effect, the resampler is inserted at the start of
the filter chain instead of the end, but that shouldn't matter much,
especially since conversion and channel mixing are conflated into the
same filter (due to libavresample's API).
2013-04-13 04:21:29 +02:00
wm4 ff6342a311 af_lavrresample: add no-detach suboption
Normally, af_lavrresample detaches itself immediately if the input and
output audio parameters are the same. no-detach prevents this.
2013-04-13 04:21:29 +02:00
wm4 abd5e8a2e7 options: remove --af-adv
Anything this option did has been removed in the preceding 3 commits.
Note that even though these options sounded like a good idea (like
setting accuracy vs. speed tradeoffs), they were not really properly
implemented.
2013-04-13 04:21:29 +02:00
wm4 08eecf070e af: remove accuracy option
All this option did was deciding whether the resample filter was to be
insert at the beginning or end of the filter chain. Always do what the
option set for accuracy did. I doubt it makes much of a difference.
libavresample does most things in just one go anyway, so it won't
matter.
2013-04-13 04:21:28 +02:00
wm4 f9a6b1c3f8 af: remove force option
Dangerous and misleading. If it turns out that this is actually needed
to make certain setups work right, it should be added back in a better
way (in a way it doesn't cause random crashes).
2013-04-13 04:21:28 +02:00
wm4 bc268b313e audio: remove float processing option
The only thing this option did was changing the behavior of af_volume.
The option decided what sample format af_volume would use, but only if
the sample format was not already float. If the option was set, it would
default to float, otherwise to S16.

Remove use of the option and all associated code, and make af_volume
always use float (unless a af_volume specific sub-option is set).

Silence maximum value tracking. This message is printed when the filter
is destroyed, and it's slightly annoying. Was enabled due to enabling
float by default.
2013-04-13 04:21:28 +02:00
wm4 41aefce730 audio: switch to libavcodec channel order, use libavresample for mixing
Switch the internal channel order to libavcodec's. If the channel number
mismatches at some point, use libavresample for up- or downmixing.
Remove the old af_pan automatic downmixing.

The libavcodec channel order should be equivalent to WAVEFORMATEX order,
at least nowadays. reorder_ch.h assumes that WAVEFORMATEX and libavcodec
might be different, but all defined channels have the same mappings.

Remove the downmixing with af_pan as well as the channel conversion with
af_channels from af.c, and prefer af_lavrresample for this. The
automatic downmixing behavior should be the same as before (if the
--channels option is set to 2, which is the default, the audio output
is forced to 2 channels, and libavresample does all downmixing).

Note that mpv still can't do channel layouts. It will pick the default
channel layout according to the channel count. This will be fixed later
by passing down the channel layout as well.

af_hrtf depends on the order of the input channels, so reorder to ALSA
(for which this code was written). This is better than changing the
filter code, which is more risky.

ao_pulse can accept waveext order directly, so set that as channel
mapping.
2013-04-13 04:21:28 +02:00
wm4 e4da671820 af: simplification
If format negotiation fails, and additional filters are inserted to fix
this, don't try to reinitialize the filter immediately. Instead, correct
the audio format, and let the caller retry.

Add a retry counter to af_reinit() to ensure that misbehaving filters
can't put the format negotiation into an endless loop.
2013-04-13 04:21:28 +02:00
wm4 8a53b3f523 af: factor channel filter insertion
Do this just like it has been done for the format filter.
2013-04-13 04:21:27 +02:00
wm4 c866583e1e af: use af_lavrresample for format conversions, if possible
Refactor to remove the duplicated format filter insertion code. Allow
other format converting filters to be inserted on format mismatches.
af_info.test_conversion checks whether conversion between two formats
would work with the given filter; do this to avoid having to insert
multiple conversion filters at once and such things. (Although this
isn't ideal: what if we want to avoid af_format for some conversions?
What if we want to split af_format in endian-swapping filters etc.?)

Prefer af_lavrresample for conversions that it supports natively,
otherwise let af_format handle the full conversion.
2013-04-13 04:21:27 +02:00
wm4 5a958921a7 af: remove automatically inserted filters on full reinit
Make sure automatically inserted filters are removed on full reinit
(they are re-added later if they are really needed). Automatically
inserted filters were never explicitly removed, instead, it was
expected that redundant conversion filters detach themselves. This
didn't work if there were several chained format conversion filters,
e.g. s16le->floatle->s16le, which could result from repeated filter
insertion and removal. (format filters detach only if input format and
output format are the same.)

Further, the dummy filter (which exists only because af.c can't handle
an empty filter chain for some reason) could introduce bad conversions
due to how the format negotiation works. Change the code so that the
dummy filter never takes part on format negotiation. (It would be better
to fix format negotiation, but that would be much more complicated and
would involving fixing all filters.)

Simplify af_reinit() and remove the start audio filter parameter. This
means format negotiation and filter initialization is run more often,
but should be harmless.
2013-04-13 04:21:27 +02:00
wm4 0a136ece5a af_lavrresample: allow other ffmpeg sample formats for input/output
The format was locked to s16. Extend it to accept all other ffmpeg
sample formats, and even allow different in- and output formats. The
generic filter code will still insert af_format on format mismatches,
though.
2013-04-13 04:21:27 +02:00
wm4 fc24ab9298 audio/filter: replace pointless memcpys with assignments
The change in af_scaletempo actually fixes a memory leak. af->data
contained a pointer to an allocated buffer, which was overwritten
during format negotiation. Set the format explicitly instead.
2013-04-13 04:21:27 +02:00
wm4 8bf759e888 af: uncrustify 2013-04-13 04:21:27 +02:00
Stefano Pigozzi 048ceef655 af_lavrresample: add new resampling filter to replace the old ones
Remove `af_resample` and `af_lavcresample`. The former is a mess while the
latter uses an API that was long deprecated in libavcodec and is now removed.

`af_lavrresample` rougly has the same features and structure of
`af_lavcresample`.

libswresample fallback by wm4.
2013-03-13 23:51:30 +01:00
wm4 fd8750c25b af_lavcac3enc: switch to avcodec_encode_audio2()
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.
2013-03-13 23:51:29 +01:00
Martin 1f7decc1a0 Rename af_volnorm to af_drc
The previous name of this filter was misleading, because it doesn’t actually
normalize volume levels. What it does is closer to performing low-quality
dynamic range compression, hence it is now called af_drc.
2013-02-12 09:53:33 +01:00
wm4 20c9dfa616 Replace strsep() uses
This function sucks and apparently is not very portable (at least on
mingw, the configure check fails). Also remove the emulation of that
function from osdep/strsep*, and remove the configure check.
2013-01-13 17:32:39 +01:00
Uoti Urpala 3f7526d641 af_volnorm: fix output range with float input
af_volnorm can process either int16_t or float audio data. The float
version used 0 to INT_MAX as full value range, when it should be 0 to
1. This effectively disabled the filter (due to all input being
considered to fall in the silence range). Fix.

Reported by Tobias Jacobi <liquid.acid@gmx.net>.
2013-01-13 13:26:07 +01:00
Stefano Pigozzi fab9febdc3 path: add mp_find_config_file and reorganize some of the code
Add `mp_find_config_file` to search different known paths and use that in
ass_mp to look for the fontconfig configuration file.

Some incidental changes spawned by this feature where:

 * Buffer allocation for the strings containing the paths is now performed
   with talloc. All of the allocations are done on a NULL context, but it still
   improves readability of the code.
 * Move the OSX function for lookup inside of a bundle: this code path was
   currently not used by the bundle generated with `make osxbundle`. The plan
   is to use it again in a future commit to get a fontconfig config file.
2012-12-15 17:38:00 +01:00
wm4 74ab902dea audio: remove support for native alaw/mulaw/adpcm output
This is considered a worthless feature. Note that alaw/mulaw/adpcm input
is unaffected: such data is handed to libavcodec and "decoded" to linear
PCM.
2012-12-11 00:37:54 +01:00
reimar a4177fd581 audio: make AC3 pass-through with ad_spdif work
Do not fall back to 0 for samplerate when parser is not initialized.

Might fix some issues with using -ac spdifenc with audio in MKV
or MP4.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35517 b3059339-0415-0410-9bf9-f77b7e298cf2

Replace outdated list of unsupported formats by list of supported formats.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35534 b3059339-0415-0410-9bf9-f77b7e298cf2

Do not call af_fmt2str on the same data over and over.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35535 b3059339-0415-0410-9bf9-f77b7e298cf2

ad_spdif: use the more specific AF_FORMAT_AC3_LE when
we handle AC3.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35536 b3059339-0415-0410-9bf9-f77b7e298cf2

Make AF_FORMAT_IS_IEC61937 include AF_FORMAT_IS_AC3.

Our AC3 "sample format" is also iec61937.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35537 b3059339-0415-0410-9bf9-f77b7e298cf2

af_format: support endianness conversion also for iec61937
formats in general, not just AC3.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35538 b3059339-0415-0410-9bf9-f77b7e298cf2

Conflicts:
	audio/filter/af_format.c

af_format: Fix check_format, non-special formats are of course supported.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35545 b3059339-0415-0410-9bf9-f77b7e298cf2

Note: see mplayer bug #2110
2012-12-03 21:08:52 +01:00
Rudolf Polzer 1085539bde af_lavcac3enc, encode: support planar formats
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.
2012-12-03 20:16:17 +01:00
reimar 3f85094d4e Fix potential bugs and issues, general cleanups
Most of these are reimar fixing issues found by Coverity static
analyzer, and possibly some more cleanup commits independent from
this.

Since these commits are rather noisy, squash them all together.

Try to make code a bit clearer.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35294 b3059339-0415-0410-9bf9-f77b7e298cf2

Conflicts:
	audio/out/ao_alsa.c

Check the correct variable for NULL.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35323 b3059339-0415-0410-9bf9-f77b7e298cf2

Remove pointless unreachable code (the loop condition already checks
the 0xff case).

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35325 b3059339-0415-0410-9bf9-f77b7e298cf2

Fix typo that might have caused reading beyond the string end.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35326 b3059339-0415-0410-9bf9-f77b7e298cf2

Do not needlessly use "long" types.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35331 b3059339-0415-0410-9bf9-f77b7e298cf2

Use AV_RB32 to avoid sign extension issues and validate offset before using it.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35332 b3059339-0415-0410-9bf9-f77b7e298cf2

Remove nonsense casts.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35343 b3059339-0415-0410-9bf9-f77b7e298cf2

Fix crash in case sh_audio allocation failed.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35348 b3059339-0415-0410-9bf9-f77b7e298cf2

Fix potential NULL dereference.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35351 b3059339-0415-0410-9bf9-f77b7e298cf2

Conflicts:
	libmpcodecs/ad_ffmpeg.c

Note: Slightly modified.

Fix malloc failure check to check the correct variable.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35353 b3059339-0415-0410-9bf9-f77b7e298cf2

Avoid code duplication and pointless casts.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35363 b3059339-0415-0410-9bf9-f77b7e298cf2

Conflicts:
	stream/tv.c

Error out if an invalid channel list name was specified
instead of continuing and reading outside array bounds
all over the place.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35364 b3059339-0415-0410-9bf9-f77b7e298cf2

Conflicts:
	stream/tv.c

Make array "static const".

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35365 b3059339-0415-0410-9bf9-f77b7e298cf2

Properly free resources even when encountering many
parse errors.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35367 b3059339-0415-0410-9bf9-f77b7e298cf2

Conflicts:
	parser-cfg.c

Avoid leaks in error handling.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35380 b3059339-0415-0410-9bf9-f77b7e298cf2

Do not do sign comparisons on "char" type which can be both signed or unsigned.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35381 b3059339-0415-0410-9bf9-f77b7e298cf2

Free cookies file data after parsing it.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35382 b3059339-0415-0410-9bf9-f77b7e298cf2

http_set_field only makes a copy of the string, so we still need to
free it.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35383 b3059339-0415-0410-9bf9-f77b7e298cf2

check4proxies does not modify input URL, so mark it const.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35390 b3059339-0415-0410-9bf9-f77b7e298cf2

Remove proxy "support" from stream_rtp and stream_upd, trying
to use a http proxy for UDP connections makes no sense.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35394 b3059339-0415-0410-9bf9-f77b7e298cf2

Conflicts:
	stream/stream_rtp.c
	stream/stream_udp.c

Add url_new_with_proxy function to reduce code duplication and memleaks.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35395 b3059339-0415-0410-9bf9-f77b7e298cf2

Conflicts:
	stream/pnm.c
	stream/stream_live555.c
	stream/stream_nemesi.c
	stream/stream_rtsp.c

Fix off-by-one errors in file descriptor validity checks.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35402 b3059339-0415-0410-9bf9-f77b7e298cf2

Remove pointless cast.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35403 b3059339-0415-0410-9bf9-f77b7e298cf2

Abort when opening the file failed instead of calling
"write" with an invalid descriptor.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35404 b3059339-0415-0410-9bf9-f77b7e298cf2

Remove pointless local variable.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35411 b3059339-0415-0410-9bf9-f77b7e298cf2

Conflicts:
	stream/http.c
2012-11-20 18:00:14 +01:00
wm4 4873b32c59 Rename directories, move files (step 2 of 2)
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.)
2012-11-12 20:08:18 +01: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