performous / performous

An open-source music and rhythm game.
https://performous.org
Other
489 stars 106 forks source link

Mp3 file shorter than 30 seconds causes song to be skipped in preview #439

Closed jose1711 closed 5 years ago

jose1711 commented 5 years ago

Do you want to request a feature or report a bug?

Bug

What did you do?

Browsing songs I discovered that a specific song is skipped - this seems to be caused by a non-standard (invalid?) mp3 file. The song however plays normally. I will share the problematic mp3 file privately when asked.

Output of performous --version: (What version of Performous are you using?)

Performous 1.1-767-g314137bf

What is your environment & configuration (arguments, platform, ...)?

Arch Linux 64bit

If applicable, please paste the log output in DEBUG level

ffmpeg/warning: Negative audio timestamp -0.025057 seconds, frame ignored.
ffmpeg/warning: Negative audio timestamp -0.025057 seconds, frame ignored.
ffmpeg/warning: Negative audio timestamp -0.025057 seconds, frame ignored.
ffmpeg/warning: Negative audio timestamp -0.023021 seconds, frame ignored.
ffmpeg/warning: Negative audio timestamp -0.025057 seconds, frame ignored.
Lord-Kamina commented 5 years ago

Are you certain this is not an caused by an invalid preview start on the song's txt file?

jose1711 commented 5 years ago

i replaced an mp3 file in the folder with another one and the problem vanished

Lord-Kamina commented 5 years ago

That is beside the point. Can you post the song's txt file?

jose1711 commented 5 years ago

Two and a Half Men - Intro Theme.txt

Lord-Kamina commented 5 years ago

So it appears you're right and it's a problem with the mp3... not sure if we can do much about that though.

jose1711 commented 5 years ago

I still find it interesting that the actual playback of the song is unaffected - just the preview is problematic. Is it because preview seeks into the file?

Lord-Kamina commented 5 years ago

It's a possibility but I'm not entirely sure. If you just leave it there, doesn't it start playing eventually?

jose1711 commented 5 years ago

Ok, I think I know what is going on. Total MP3 playing time is 22 seconds, default preview time is 30 seconds since song beginning:

game/songparser.cc
  s.preview_start = (type == INI ? 5.0 : 30.0);  // 5 s for band mode, 30 s for others

That means that performous is trying to seek beyond the end of the playing time.

Lord-Kamina commented 5 years ago

That makes all the sense in the world then.

nieknooijens commented 5 years ago

since the PR is merged isn't this closed then?