deadbeef icon indicating copy to clipboard operation
deadbeef copied to clipboard

Unable to seek after ~12:25h / 13:31h

Open SuperVirus opened this issue 2 years ago • 4 comments

DeaDBeeF is unable to seek beyond a certain timestamp in very long audio files. The limit is about 13:31h for stereo files with a sample rate of 44.100 and about 12:25h for stereo files with a sample rate of 48.000. Only seeking in the file is affected. Playback will continue beyond those limits without problems.

It guess a 32bit integer is used for the seek position: 44100×2×3600×13,5 => 4 286 520 000 samples 48000×2×3600×12,4 => 4 285 440 000 samples Both values are close the maximum of 4 294 967 295 for a 32bit integer.

Steps to reproduce the problem

  • Open a very long (min 14h audio file in DeaDBeeF)
  • Seek to a timestamp > 13:40h

What's going on? Describe the problem in as much detail as possible

Depending on the decoder plugin the behavior differs:

  • For FLAC and OPUS the seek does not happen and the playback continues.
  • For ffmpeg (tested with MP4-AAC and OPUS) the playback position jumps to the start of the file.

Information about the software:

Deadbeef version: 1.8.7 and git 6d3b11262d5fbe0326b408bc73ae01861505d4ef OS: Arch Linux 64bit

Here are some 14h test files (FLAC, only silence) :testfiles.zip

SuperVirus avatar Jul 14 '21 00:07 SuperVirus

It's the same with any files.. It's not hard to fix, but a little time consuming. In the meantime I'm doing 2 things:

  1. adding a new extended decoder plugin interface, to add 64 bit seek offset API.
  2. implementing the interface and using 64 bit offset in the flac plugin.

Oleksiy-Yakovenko avatar Jul 14 '21 17:07 Oleksiy-Yakovenko

(not closing the issue yet, until it's fixed in all relevant decoders).

Oleksiy-Yakovenko avatar Jul 14 '21 17:07 Oleksiy-Yakovenko

Sorry, it was closed by a git merge

Oleksiy-Yakovenko avatar Aug 02 '21 17:08 Oleksiy-Yakovenko

Codec status

  • ✅ flac
  • ✅ ffmpeg
  • ✅ opus
  • ✅ aac
  • ✅ alac
  • ❌ ape (seems to have a 32 bit format limitation)
  • ✅ mp3
  • ✅ musepack
  • ✅ sndfile
  • ❌ tta (32 bit format limitation)
  • ✅ wavpack
  • ✅ wma
  • ✅ vorbis

Oleksiy-Yakovenko avatar Jun 25 '22 17:06 Oleksiy-Yakovenko