Skip to content

Commit 359fcb7

Browse files
committed
Ditch attempts trying to obtain sound duration of MP3s
Crashes on Linux. Apparently returns incorrect values on Windows.
1 parent a999c79 commit 359fcb7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sp/src/game/shared/SoundEmitterSystem.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,11 @@ class CSoundEmitterSystem : public CBaseGameSystem
10011001

10021002
if ( duration )
10031003
{
1004-
*duration = enginesound->GetSoundDuration( pSample );
1004+
if ( Q_stristr( pSample, ".mp3" ) ) {
1005+
*duration = 0;
1006+
} else {
1007+
*duration = enginesound->GetSoundDuration( pSample );
1008+
}
10051009
}
10061010

10071011
TraceEmitSound( "EmitAmbientSound: Raw wave emitted '%s' (ent %i)\n",

0 commit comments

Comments
 (0)