Opened 15 years ago

Closed 14 years ago

#1334 closed defect (invalid)

ladspa filter calling setlocale breaks MPlayer

Reported by: lorefice2@… Owned by: reimar
Priority: normal Component: af
Version: HEAD Severity: normal
Keywords: Cc:
Blocked By: Blocking:
Reproduced by developer: no Analyzed by developer: no

Description

When mplayer is invoked in slave mode with a ladspa filter, the decimal separator it expects from input becomes "," and not "."
Also, the volume is reported using "," and not ".", and output changes too:

# mplayer -slave "media.mp3" -input file=/tmp/fifo
/../
A: 1.7 (01.6) of 272.0 (04:32.0) 0.7%
(note the point in A: 1.7)
--
On another terminal i type:
echo "get_property volume" >/tmp/fifo

And i got:
ANS_volume=77.000000
(note the point in "77.00")
---

Now with a ladspa filter:
#mplayer -slave "media.mp3" -af ladspa=/usr/lib/ladspa/fast_lookahead_limiter_1913.so:fastLookaheadLimiter:10:0:2 -input file=/tmp/fifo
/../
A: 1,1 (01.1) of 272,0 (04:32.0) 1,4%
(now i got a comma in "1,1")

On another terminal i type:
echo "get_property volume" >/tmp/fifo

And i got:
ANS_volume=77,000000
(note the point in "77,00")


I observed similar behaviour in other functions, eg: when i want to use the speed_mult command, i have to use commas when -af ladspa and points otherwise.

Change History (4)

comment:1 by reimar, 14 years ago

* Bug 1665 has been marked as a duplicate of this bug. *

comment:2 by reimar, 14 years ago

Owner: changed from reynaldo@… to reimar
Summary: Strange behaviour when using ladspa filters.ladspa filter calling setlocale breaks MPlayer
Version: 1.0rc2HEAD

The filter obviously calls setlocale.
Since setlocale changes global state in a non-threadsafe way that is already unacceptable for a library but even worse it does not even try to undo the change.
I consider this a bug in the ladspa filter, even though a workaround may be possible since MPlayer is mostly single-threaded.

comment:3 by reimar, 14 years ago

I forgot: you can of course "fix" it by calling MPlayer as
LC_ALL=C mplayer ....

comment:4 by lorefice2@…, 14 years ago

Resolution: invalid
Status: newclosed

You are right.
I was deceived by the fact that other plugins reacted the same way, so i thought that the culprit was the ladspa audio filter code in mplayer.
Now i've also found a message on lists.mplayerhq.hu about this issue, the author just speaks about "some" ladspa filters.
http://lists.mplayerhq.hu/pipermail/mplayer-users/2009-January/075746.html

Thank you very much.

Note: See TracTickets for help on using tickets.