Make audtool seek in milliseconds
If you try using 'audtool --playback-seek 5', it will move to a position 5 seconds into the song. If you use 'audtool --playback-seek-relative 5', it will move 5 seconds forward from the current position. Both commands should, according to the documentation, move by 5 milliseconds, not 5 seconds. Needless to say, the documented behavior would be more generally useful.
The reason is clear in the source: In src/audtool/handlers_playback.c, both playback_seek() and playback_seek_relative() multiply their received arguments by 1000. In my own copy of the source, I have removed the '*1000' from both lines, and things appear to work without issue.
I don't have older copies of the source, but this bug is present in version 3.2.2
#2 Updated by Rick Koshi about 9 years ago
Ah. I see now that I was looking at an older version of the manual page, from 3.0.2 (installed on my Arch Linux system). I only downloaded 3.2.2 when I ran into this problem.
Is there a reason the manual page was changed instead of changing the source? I think it's useful to be able to seek with sub-second precision. For example, I am using it to pause/stop a song, play something else (short) in the same player, then resume the original song at the same place. It is audibly jarring if I can't position it precisely.
If backward compatibility is a concern, it would be equally useful to accept an argument in seconds, but allow a floating point argument instead of forcing it to integer.
#3 Updated by John Lindgren about 9 years ago
- Tracker changed from Bug to Feature
- Subject changed from audtool does not seek as documented -- argument is seconds, not milliseconds to Make audtool seek in milliseconds
I expect the manual page was changed, rather than the source, so as not to break existing scripts that relied on the historical behavior. Changing to a feature request.
#6 Updated by John Lindgren over 8 years ago
- Status changed from New to Closed
Millisecond accuracy is possible now by using a decimal, as you suggested: