X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/526ddb13e289be62ee1926c265138c0dea36fa56..5b7352027902bebecd06e2a124492fc0ee27f4e2:/utils/wxMMedia2/lib/sndoss.cpp diff --git a/utils/wxMMedia2/lib/sndoss.cpp b/utils/wxMMedia2/lib/sndoss.cpp index 8b890a02e8..60fb82a2bd 100644 --- a/utils/wxMMedia2/lib/sndoss.cpp +++ b/utils/wxMMedia2/lib/sndoss.cpp @@ -46,6 +46,7 @@ wxSoundStreamOSS::wxSoundStreamOSS(const wxString& dev_name) close(m_fd); m_oss_stop = TRUE; + m_q_filled = TRUE; } wxSoundStreamOSS::~wxSoundStreamOSS() @@ -59,11 +60,12 @@ wxUint32 wxSoundStreamOSS::GetBestSize() const return m_bufsize; } -wxSoundStream& wxSoundStreamOSS::Read(void *buffer, size_t len) +wxSoundStream& wxSoundStreamOSS::Read(void *buffer, wxUint32 len) { int ret; - m_lastcount = (size_t)ret = read(m_fd, buffer, len); + m_lastcount = (wxUint32)ret = read(m_fd, buffer, len); + m_q_filled = TRUE; if (ret < 0) m_snderror = wxSOUND_IOERR; @@ -73,11 +75,12 @@ wxSoundStream& wxSoundStreamOSS::Read(void *buffer, size_t len) return *this; } -wxSoundStream& wxSoundStreamOSS::Write(const void *buffer, size_t len) +wxSoundStream& wxSoundStreamOSS::Write(const void *buffer, wxUint32 len) { int ret; - m_lastcount = (size_t)ret = write(m_fd, buffer, len); + m_lastcount = (wxUint32)ret = write(m_fd, buffer, len); + m_q_filled = TRUE; if (ret < 0) m_snderror = wxSOUND_IOERR; @@ -220,6 +223,7 @@ static void _wxSound_OSS_CBack(gpointer data, int source, void wxSoundStreamOSS::WakeUpEvt(int evt) { + m_q_filled = FALSE; OnSoundEvent(evt); } @@ -263,6 +267,7 @@ bool wxSoundStreamOSS::StartProduction(int evt) ioctl(m_fd, SNDCTL_DSP_SETTRIGGER, &trig); m_oss_stop = FALSE; + m_q_filled = FALSE; return TRUE; } @@ -278,9 +283,15 @@ bool wxSoundStreamOSS::StopProduction() close(m_fd); m_oss_stop = TRUE; + m_q_filled = TRUE; return TRUE; } +bool wxSoundStreamOSS::QueueFilled() const +{ + return m_q_filled; +} + // // Detect the closest format (The best). //