Commit Graph

412 Commits

Author SHA1 Message Date
Uoti Urpala a4f4130819 cleanup: do libav* initialization on startup
Do the global initialization of libavcodec and libavformat
(avcodec_register_all(), av_register_all()) immediately on program
startup and remove the initialization calls from various individual
modules that use libavcodec/libavformat functionality.
2011-07-18 00:57:05 +03:00
Clément Bœsch 2174cbfa2f cleanup: silence most of the clang warnings 2011-07-09 04:23:24 +03:00
Rudolf Polzer 0fff1380b1 audio: clamp sample values in float->int format conversions
Make af_format clamp float sample values to the range [-1, 1] before
conversion to integer types. Before any out-of-range values wrapped
around and caused nasty artifacts. This filter is used for all
automatic format conversions; thus any decoder that outputs floats
with possible out-of-range values would have been affected by the bad
conversion if its output needed to be converted to integers for AO.
2011-05-04 17:25:11 +03:00
Clément Bœsch 52743acba3 cleanup: avoid various GCC warnings 2011-04-20 04:22:53 +03:00
Uoti Urpala b8e1456c25 af_lavcac3enc: fix channel reordering
Reordering to libavcodec channel order was broken with libavcodec
versions using float input to the ac3 encoder because the reordering
code still assumed int16 sample size. Fix.
2011-03-31 23:51:19 +03:00
Uoti Urpala e1a8392cae fix compilation with old FFmpeg versions
af_lavcac3enc: use old SampleFormat names without AV_ prefix, the
latter were only added in 2010-11

vd_ffmpeg: add ifdef around CODEC_ID_LAGARITH use

demux_real: use ffmpeg_files/intreadwrite.h

stream/http.c, stream/realrtsp/real.c: define AV_BASE64_SIZE macro for
old libavutil versions lacking it
2011-02-08 19:07:10 +02:00
Uoti Urpala c24d4e9ec2 af_lavcac3enc: fix for lavc AC-3 encoder change to float input
The libavcodec AC-3 encoder was changed to use floats, and take
floating point samples as input (the fixed-point version is still
available under the new name "ac3_fixed"). This broke af_lavcac3enc
because it blindly assumed without checking that the "ac3" encoder
would take signed 16-bit integer samples. Improve af_lavcac3enc so
that it checks the sample formats supported by the encoder and can
handle either int16_t or float.

Perhaps an option to keep using integer input but instead switch the
encoder name to "ac3_fixed" for new libavcodec versions would have
some value. Then again, maybe not. Using the preferred data format of
the default "ac3" encoder should normally be best, so probably better
not add such an option unless real need appears.
2011-02-03 04:55:20 +02:00
cboesch fe3c4810e1 cleanup: remove NULL checks before free() all over the code
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32624 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-14 13:11:20 +02:00
reimar 3452e2e907 libaf: Make af_reinit "public", to allow using it in future patches
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32504 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:18:37 +02:00
cigaes 579d743159 audio: auto-add downmix filter when stereo output is requested
When -channels 2 [default] is specified and the audio decoder used
does not support internal downmixing, automatically add a pan filter
after the decoder to downmix to stereo.

Patch by Clément Bœsch, ubitux gmail com

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32356 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:18:07 +02:00
Uoti Urpala 6335de8621 libaf: add opts pointer to struct af_stream 2010-11-02 04:18:07 +02:00
reimar 7dd0d8f6df af.c: Minor simplification of af_init
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32347 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:18:07 +02:00
reimar 8d466ff705 af.c: add "const" to af_append(), af_prepend() prototypes
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32346 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:18:07 +02:00
Uoti Urpala c5e462b33d build: enable/disable all FFmpeg libraries together
Enable all of libavcodec, libavformat, libswscale, and libpostproc
together (libavutil is always required).

based on svn commit by diego:

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32226 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:16:55 +02:00
diego f2899d96ee Add central init_avcodec() to avoid duplicated libavcodec init code
Patch by Vlad Seryakov, vseryakov gmail com

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

Refactor more instances of avcodec_initialized handling into init_avcodec().
This is a leftover from the previous commit.

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

Add missing #include for vd_ffmpeg.h; fixes the warning:
libmpcodecs/vf_zrmjpeg.c:472: warning: implicit declaration of function 'init_avcodec'

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32176 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:15:51 +02:00
reimar f8509c52c0 af_lavcresample: avoid multiple calls to av_resample_init
Avoid calling av_resample_init again when the values are the same as before.
The init function can be called multiple times when e.g. additional format
filters are inserted, so this speeds things up.
Patch by Dan Oscarsson [Dan.Oscarsson tieto com].

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

Reindent.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31699 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:14:43 +02:00
reimar caf32aef3f af_export: Avoid void *-arithmentic warnings
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31608 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:14:19 +02:00
reimar 6142e86b84 af_ladspa: Fix multiple instances of a filter type
Ensure that activate is called on each filter instance, even if we
have e.g. multiple mono filters handling a multichannel file.
Fixes one of the bugs reported as bug #1685.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31558 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:11:43 +02:00
diego 70630d72a7 af_extrastereo: Improve filter description
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31544 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:11:42 +02:00
Uoti Urpala c3b6850e81 af_lavcac3enc: fix assert failure "s->expect_len <= s->pending_data_size"
The code handling input format negotiation incorrectly used the bps
value of the suggested input format instead of the format it was going
to actually use. As a result the player could abort with the above
assertion failure. Fix.
2010-10-14 22:33:09 +03:00
Uoti Urpala ba5f104836 af_lavcac3enc: actually enable the filter by default
The filter was changed earlier to allow building without FFmpeg
internal symbols. Make it actually available by default.
2010-05-26 11:15:54 +03:00
Uoti Urpala c5812d6056 af_lavcac3enc: make the filter work without FFmpeg internals
The only FFmpeg internal symbols required were some constants. Define
them in the file itself instead. Also add some checks and fixes to
make the code more robust and fix a potential memory corruption
problem.
2010-05-14 04:25:49 +03:00
Uoti Urpala 4785c2617e Merge svn changes up to r30967 2010-04-26 17:42:20 +03:00
diego 70c66c0476 Rename get_path.[ch] --> path.[ch].
These files now contain different functions related to path handling.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30943 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-20 23:38:27 +00:00
Uoti Urpala 00323c06e2 Delete things related to old translation system
Remove the help/ subdirectory, configure code to create toplevel
help_mp.h, and all the '#include "help_mp.h"' lines from .c files.
2010-03-10 03:47:14 +02:00
Uoti Urpala 13221a7165 Merge svn changes up to r30663
Conflicts:
	gui/cfg.c
	libmpcodecs/vd_dmo.c
	mplayer.c
2010-03-10 00:13:11 +02:00
Uoti Urpala b0986b3760 Merge svn changes up to r30463
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.
2010-03-09 18:59:15 +02:00
Uoti Urpala b34a88e4f4 translations: tweak cases that relied on concatenating adjacent strings
Tweak some code parts that used to rely on string literals from
translation macros being concatenated with other adjacent string
literals. Break up the resulting string into independently translated
parts, so that the existing translations for those parts can still be
used.
2010-03-07 21:35:23 +02:00
Uoti Urpala 5234c72e28 Restore collapsed whitespace in output messages
For some reason commit e306174952, which
replaced translation macro names with the corresponding English
strings, also collapsed multiple consecutive space characters into
one. Change most of these back. In a couple of cases the amount of
whitespace is important for alignment, and for the rest it at least
keeps the strings closer to the existing translations.
2010-03-07 21:34:54 +02:00
diego 8ba6b4eaf9 cosmetics: Remove pointless empty lines at EOF.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30675 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-02-20 21:02:49 +00:00
reimar dd79cbf17b Move code that makes the filter chain match the desired output format into
a separate function.
Call this function also from af_add, fixes audio corruption with e.g.
-softvol -af format=s16be (bug #1561).


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30659 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-02-19 21:52:29 +00:00
reimar 3bbbb21ada Make the code match the documentation by making higher-quality but slower
audio filtering the default.
This mostly means lavcresample being the default instead of plain "resample".


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30455 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-30 10:09:14 +00:00
Uoti Urpala 4ebf007580 Merge svn changes up to r30375 2010-01-25 15:36:38 +02:00
Uoti Urpala 69fe2522f8 Merge svn changes up to r30301 2010-01-25 15:07:30 +02:00
reimar 1a5841fbbb Add a proper header for our strsep implementation so strsep will
not be used without a declaration, causing issues on 64 bit systems.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30355 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-17 15:08:31 +00:00
reimar b27ec53011 Let the format filter do the AC3 endianness conversion instead of duplicating
the conversion code over and over.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30285 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-11 20:40:51 +00:00
reimar 33bc71f10d Add support for distinguishing between little- and big-endian SPDIF AC3
and converting between both.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30283 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-11 20:27:52 +00:00
reimar 76feee19c4 Add a hack to af_fmt2bits to recognize AC3 as a 16-bit format, since this
is more correct than 8 bit for alignment purposes.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30278 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-11 19:37:50 +00:00
reimar 6910cdaae1 Add and use AF_FORMAT_IS_AC3 macro.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30276 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-11 19:23:18 +00:00
reimar a8a53e872e Revert r30170, AF_FORMAT_AC3 is supposed to be the special mask,
and should not include other parts.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30275 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-11 19:08:15 +00:00
Uoti Urpala d157b2a8ce Merge svn changes up to r30173 2010-01-08 01:17:56 +02:00
reimar 13fe3d4986 Mark AC3 as 16-bit format, this simplifies alignment calculation and fixes
hwac3 with ALSA reportedly broken by r29750.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30170 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-02 20:45:27 +00:00
Uoti Urpala ed333bb31d Merge svn changes up to r29971 2009-11-29 06:11:02 +02:00
tack b2adf9d98d Fix mangling of 24-bit audio during channel reorder.
Only 1/3 of the samples in the buffer passed to reorder_channel_nch()
were being reordered.  For 8-, 16-, and 32-bit audio, the buffers could
be treated as int8_t, int16_t, and int32_t respectively.  24-bit audio
was being processed as int8_t, requiring iteration over n_samples*3, not
n_samples.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29971 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-11-28 18:23:26 +00:00
Uoti Urpala ac8e40b4ff af_scaletempo: Fix delay value after changing scale to 1
The scaletempo filter has a special-case check to return the samples
unchanged if the current scaling factor is 1. In this case code
setting af->delay wasn't run. If the scale had had a different value
and then been changed to 1 as a result of a playback speed change then
the delay field could have a nonzero value left, resulting in A/V sync
errors. Fix by setting the delay field to 0 in the scale == 1 special
case code.
2009-11-22 12:41:04 +02:00
Uoti Urpala 287b62163e Merge svn changes up to r29912 2009-11-16 07:01:46 +02:00
tack 3c2afd6786 Add support for 8 channel audio.
Where 8 channel support is non-trivial (e.g. ao_dsound), at least ensure we
fail gracefully.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29868 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-11-10 00:45:19 +00:00
tack 1d30062395 Cosmetics: remove trailing whitespace from file.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29867 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-11-10 00:43:14 +00:00
tack b6712cc6c2 reorder_ch: Remove unneeded AF_CHANNEL_LAYOUT_LAVC_AAC_DEC_*
All references to these values were removed r29821.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29822 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-11-04 00:58:11 +00:00
Uoti Urpala 7fd3eb0f74 Merge svn changes up to r29752
As part of merging subtitle-in-terminal changes make
update_subtitles() only clear existing subtitles if called with the
reset argument, and not try to set new ones. Later calls should set
the needed new subtitles, and this change avoids some problems with
trying to set subtitles when mp_property_sub() in command.c gets
called from initialization code before full initialization.
2009-10-06 04:48:00 +03:00