Commit Graph

23 Commits

Author SHA1 Message Date
Stefano Pigozzi 0374ddb79d audio: untypedef af_data and rename it to mp_audio
this is to have something specular to mp_image
2012-11-02 19:19:28 +01:00
Uoti Urpala 616047c618 af_scaletempo: reset latency info when reconfiguring
af_scaletempo kept outdated values in the af->delay field after
reconfiguration until some audio was fed through the filter. This
could affect audio sync code after a playback speed change.
Additionally, in the special case speed=1 the code did not set the
af->mul field at all. Initialize both fields after reconfiguration.
2012-10-28 17:36:28 +01:00
wm4 413c6f5b30 af_scaletempo: fix crash on channel reconfiguration
This crash happened when audio channels were reconfigured from 6
channels to 2, and playback speed was set to 2.

The crash is caused by passing a negative size to memcpy. It appears
reinitialization doesn't clear the buffer. As the result, the buffer
can be larger as the maximum buffer size, i.e. the invariant
bytes_queued <= bytes_queue is violated.

Fix this by resetting the buffer length on reconfiguring (set the
bytes_queued vairable to 0). Also reset some other state for clarity
and robustness, although these changes aren't strictly needed for
avoiding the actual crash.

This may also get rid of some noise played right after reinitialization,
as the re-used buffer was in the wrong audio format.
2012-08-26 22:17:27 +02: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 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 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
Amar Takhar e306174952 Translation system changes part 2: replace macros by strings
Replace all MSGTR_ macros in the source by the corresponding English
string.
2009-07-07 01:38:20 +03:00
Amar Takhar b5972d6f14 Translation system changes part 1: wrap translated strings
Replace mp_msg() calls which have a translated string as the format
argument with mp_tmsg and add _() around all other translated strings.
2009-07-07 01:28:07 +03:00
bircoph 42a792bbc7 Remove af_msg special-casing API in libaf.
Replace it by standard mp_msg message system.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29088 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-03-28 19:57:56 +00:00
diego 0b4bfff65c Use standard license headers with standard formatting.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26772 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-05-14 17:24:10 +00:00
reimar def649b0e4 100l, bzero is deprecated, use memset instead
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25216 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-11-30 21:29:45 +00:00
reimar ce11ba5de5 Add padding and unroll loop 4x for at least another 10% speedup
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25104 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-11-18 22:13:49 +00:00
reimar 0f0e2f5f5b Change to a 64 bit accumulation variable instead of shifting.
Changing the way the loop is done is necessary to reduce register pressure.
About 20% speedup even on 32 bit x86.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25103 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-11-18 18:52:51 +00:00
reimar 13a205e075 100l, *ppc++ was supposed to be replaced by ppc[i] in r25100, but that is not any faster.
Just removing the += s->samples_overlap - s->num_channels; still provides a
ca. 20% speedup on x86 (AThlon X2 64) with gcc 3.4 (compiler stupidity?)


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25102 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-11-18 18:33:45 +00:00
reimar 66c4759992 Use "long" instead of "int" for innermost loop variable.
About 12% faster on x86_64


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25101 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-11-18 17:44:11 +00:00
reimar 0bc7ce3b04 Rearrange scaletempo inner loop.
Speedup on x86 with gcc 3.4 36%, on x86_64 with gcc 4.1 5%


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25100 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-11-18 17:28:27 +00:00
reimar 1c05db4406 100l, someone mixed up && and ||, so if allocation of only one buffers failed
that would not be detected.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25098 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-11-18 15:48:20 +00:00
reimar 4112aa7bcd Avoid some casts by changing int8_t* to void* in af_scaletempo
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25097 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-11-18 14:57:59 +00:00
uau d7f6cb23de A/V sync: take audio filter buffers into account
Substract the delay caused by filter buffering when calculating
currently playing audio position. This matters for af_scaletempo which
buffers significant and varying amounts of data. For other current
filters the effect is normally insignificant.

Instead of the old time-based filter delay field (which was ignored)
this version stores the per-filter delay in units of bytes input read
without corresponding output. This allows the current scaletempo
behavior where other filters before and after it can see the same
nominal samplerate even though the real duration of the data varies;
in this case the other filters can not know the delay they're causing
in terms of real time.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24928 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-11-01 06:52:50 +00:00
uau de034ce87f af_scaletempo: code cleanup
Make internal functions static and remove leading '_' from some
function names. Cast pointers to compatible 8-bit pointer types
instead of ints when calculating their difference.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24927 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-11-01 06:52:47 +00:00
uau e803711bbd af_scaletempo: Fix crash in option parsing
The value of the "speed" suboption was not initialized before calling
subopt_parse(). If the command line had suboptions but "speed" was not
one of them then the code accessed an uninitialized pointer and
possibly crashed. Fixed by initializing the option value.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24926 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-11-01 06:52:44 +00:00
uau ff1568af58 af_scaletempo: Fix audio copy position
Because of a missing *num_channels factor the filter copied audio from
an incorrect position. This mixed up the channel order and hurt audio
quality even if the channels had identical content.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24925 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-11-01 06:52:41 +00:00
uau d33703496c Add audio filter scaletempo
Patch by Robert Juliano, juliano.1 osu edu


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24924 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-11-01 06:52:38 +00:00