summaryrefslogtreecommitdiffstats
path: root/src/audio/oal/stream.cpp
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2020-10-05 12:59:40 +0200
committereray orçunus <erayorcunus@gmail.com>2020-10-05 13:23:12 +0200
commit1a0b71bd47fc181ea7e8042e0faa35eb7f94cac8 (patch)
treefa290840a56f7a903a38881f2cd1efccb63a186f /src/audio/oal/stream.cpp
parentMerge pull request #738 from erorcun/master (diff)
downloadre3-1a0b71bd47fc181ea7e8042e0faa35eb7f94cac8.tar
re3-1a0b71bd47fc181ea7e8042e0faa35eb7f94cac8.tar.gz
re3-1a0b71bd47fc181ea7e8042e0faa35eb7f94cac8.tar.bz2
re3-1a0b71bd47fc181ea7e8042e0faa35eb7f94cac8.tar.lz
re3-1a0b71bd47fc181ea7e8042e0faa35eb7f94cac8.tar.xz
re3-1a0b71bd47fc181ea7e8042e0faa35eb7f94cac8.tar.zst
re3-1a0b71bd47fc181ea7e8042e0faa35eb7f94cac8.zip
Diffstat (limited to 'src/audio/oal/stream.cpp')
-rw-r--r--src/audio/oal/stream.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/audio/oal/stream.cpp b/src/audio/oal/stream.cpp
index eeaaafb0..c4f1b67c 100644
--- a/src/audio/oal/stream.cpp
+++ b/src/audio/oal/stream.cpp
@@ -155,13 +155,13 @@ public:
void Seek(uint32 milliseconds)
{
if ( !IsOpened() ) return;
- mpg123_seek(m_pMH, ms2samples(milliseconds)*GetSampleSize(), SEEK_SET);
+ mpg123_seek(m_pMH, ms2samples(milliseconds), SEEK_SET);
}
uint32 Tell()
{
if ( !IsOpened() ) return 0;
- return samples2ms(mpg123_tell(m_pMH)/GetSampleSize());
+ return samples2ms(mpg123_tell(m_pMH));
}
uint32 Decode(void *buffer)
@@ -247,13 +247,13 @@ public:
void Seek(uint32 milliseconds)
{
if ( !IsOpened() ) return;
- op_pcm_seek(m_FileH, ms2samples(milliseconds) * GetSampleSize());
+ op_pcm_seek(m_FileH, ms2samples(milliseconds) / GetChannels());
}
uint32 Tell()
{
if ( !IsOpened() ) return 0;
- return samples2ms(op_pcm_tell(m_FileH)/GetSampleSize());
+ return samples2ms(op_pcm_tell(m_FileH) * GetChannels());
}
uint32 Decode(void *buffer)
@@ -461,8 +461,8 @@ uint32 CStream::GetPosMS()
alGetSourcei(m_alSource, AL_BYTE_OFFSET, &offset);
return m_pSoundFile->Tell()
- - m_pSoundFile->samples2ms(m_pSoundFile->GetBufferSamples() * (NUM_STREAMBUFFERS-1))
- + m_pSoundFile->samples2ms(offset/m_pSoundFile->GetSampleSize());
+ - m_pSoundFile->samples2ms(m_pSoundFile->GetBufferSamples() * (NUM_STREAMBUFFERS-1)) / m_pSoundFile->GetChannels()
+ + m_pSoundFile->samples2ms(offset/m_pSoundFile->GetSampleSize()) / m_pSoundFile->GetChannels();
}
uint32 CStream::GetLengthMS()