Feature #95
Make audtool seek in milliseconds
0%
Description
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
History
#1 Updated by John Lindgren over 12 years ago
What documentation are you referring to? The manual page I have for audtool says seconds, not milliseconds.
#2 Updated by Rick Koshi over 12 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 over 12 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.
#4 Updated by John Lindgren over 12 years ago
- Category set to audtool
#5 Updated by John Lindgren about 12 years ago
- Assignee set to John Lindgren
- Target version set to 3.4
#6 Updated by John Lindgren about 12 years ago
- Status changed from New to Closed
Millisecond accuracy is possible now by using a decimal, as you suggested:
https://github.com/audacious-media-player/audacious/commit/91b773af0f6c98cefb34156ad4207baca3d4173e