Opened 20 years ago

Closed 19 years ago

Last modified 19 years ago

#23 closed defect (fixed)

problems with parsing floating point numbers

Reported by: ace@… Owned by: alex@…
Priority: normal Component: core
Version: HEAD Severity: normal
Keywords: Cc:
Blocked By: Blocking:
Reproduced by developer: no Analyzed by developer: no

Description

While experimenting with pan filter, I've messed with strange behaviour with
floating numbers. The problem is that not in all locales decimal point
delimeter is dot. For example, I use ru_RU locale and decimal point delimeter
is coma. So I get such things, which many users noted:

LANG=ru_RU;mplayer -ao alsa9:surround51 -af pan=3:1:0:0:1:0.5:0.5 -v -channels
3 movie.avi

Checking audio filter chain for 48000Hz/2ch/16bit -> 48000Hz/3ch/16bit...
[libaf] Adding filter pan
[pan] Pan level from channel 0 to channel 0 = 1,000000
[pan] Pan level from channel 1 to channel 0 = 0,000000
[pan] Pan level from channel 2 to channel 0 = 0,000000
[pan] Pan level from channel 0 to channel 1 = 1,000000
[pan] Pan level from channel 1 to channel 1 = 0,000000
[libaf] Adding filter format
[format] Changing sample format from 16bit little endian signed int to 32bit
little endian float
AF_pre: af format: 4 bps, 3 ch, 48000 hz, little endian float

LANG=;mplayer -ao alsa9:surround51 -af pan=3:1:0:0:1:0.5:0.5 -v -channels 3
movie.avi

Checking audio filter chain for 48000Hz/2ch/16bit -> 48000Hz/3ch/16bit...
[libaf] Adding filter pan
[pan] Pan level from channel 0 to channel 0 = 1.000000
[pan] Pan level from channel 1 to channel 0 = 0.000000
[pan] Pan level from channel 2 to channel 0 = 0.000000
[pan] Pan level from channel 0 to channel 1 = 1.000000
[pan] Pan level from channel 1 to channel 1 = 0.500000
[pan] Pan level from channel 2 to channel 1 = 0.500000
[libaf] Adding filter format
[format] Changing sample format from 16bit little endian signed int to 32bit
little endian float
AF_pre: af format: 4 bps, 3 ch, 48000 hz, little endian float

Maybe this must be noted in documentation? From other side, I can't use comas
in this case, because coma separates filters names. Or just set decimal point
delimeter to dot, because it reflects not only on pan filter, but on all
floating point numbers?

Attachments (1)

lc_numeric.diff (911 bytes ) - added by reimar 20 years ago.
please test

Download all attachments as: .zip

Change History (4)

by reimar, 20 years ago

Attachment: lc_numeric.diff added

please test

comment:1 by reimar, 20 years ago

Try the attached patch as a first try. I'm not sure if I'd like this to be in
CVS, but anyway.
I couldn't test if it works as my locales are broken at the moment...

comment:2 by ace@…, 20 years ago

(In reply to comment #1)

please test


Yes, it works for me. Both mplayer and mencoder.

comment:3 by reimar, 19 years ago

Resolution: fixed
Status: newclosed

For commandline MPlayer this should be fixed by the removal of all setlocale
calls (needed to fix win32codecs with tr_TR locale). gmplayer due to its gtk
usage is still broken though.

Note: See TracTickets for help on using tickets.