gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog backend/sound_handler_sdl.cpp


From: Tomas Groth
Subject: [Gnash-commit] gnash ChangeLog backend/sound_handler_sdl.cpp
Date: Wed, 08 Aug 2007 09:14:14 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Tomas Groth <tgc>       07/08/08 09:14:14

Modified files:
        .              : ChangeLog 
        backend        : sound_handler_sdl.cpp 

Log message:
                * backend/sound_handler_sdl.cpp: Fix counting of samples played,
                  and use the output samplerate to calculate the playhead 
position
                  in time, fixes/improves bug #20684.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3962&r2=1.3963
http://cvs.savannah.gnu.org/viewcvs/gnash/backend/sound_handler_sdl.cpp?cvsroot=gnash&r1=1.77&r2=1.78

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3962
retrieving revision 1.3963
diff -u -b -r1.3962 -r1.3963
--- ChangeLog   7 Aug 2007 21:01:05 -0000       1.3962
+++ ChangeLog   8 Aug 2007 09:14:14 -0000       1.3963
@@ -1,3 +1,9 @@
+2007-08-08 Tomas Groth Christensen <address@hidden>
+
+       * backend/sound_handler_sdl.cpp: Fix counting of samples played,
+         and use the output samplerate to calculate the playhead position
+         in time, fixes/improves bug #20684.
+
 2007-08-07 Sandro Santilli <address@hidden>
 
        * gui/Makefile.am: clean the 'gnash' script on make clean. 

Index: backend/sound_handler_sdl.cpp
===================================================================
RCS file: /sources/gnash/gnash/backend/sound_handler_sdl.cpp,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -b -r1.77 -r1.78
--- backend/sound_handler_sdl.cpp       7 Aug 2007 16:27:37 -0000       1.77
+++ backend/sound_handler_sdl.cpp       8 Aug 2007 09:14:14 -0000       1.78
@@ -18,7 +18,7 @@
 // Based on sound_handler_sdl.cpp by Thatcher Ulrich http://tulrich.com 2003
 // which has been donated to the Public Domain.
 
-// $Id: sound_handler_sdl.cpp,v 1.77 2007/08/07 16:27:37 tgc Exp $
+// $Id: sound_handler_sdl.cpp,v 1.78 2007/08/08 09:14:14 tgc Exp $
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -579,9 +579,9 @@
        active_sound* asound = sounddata->m_active_sounds[0];
 
        // Return the playhead position in milliseconds
-       unsigned int ret = asound->samples_played / sounddata->sample_rate * 
100;
-       ret += ((asound->samples_played % sounddata->sample_rate) * 100) / 
sounddata->sample_rate;
-       if (sounddata->stereo) ret = ret / 2;
+       unsigned int ret = asound->samples_played / audioSpec.freq * 1000;
+       ret += ((asound->samples_played % audioSpec.freq) * 1000) / 
audioSpec.freq;
+       if (audioSpec.channels > 1) ret = ret / audioSpec.channels;
        return ret;
 }
 
@@ -698,7 +698,9 @@
 
        // Update sound info
        sound->raw_position += mix_length;
-       sound->samples_played += mix_length;
+
+       // Sample size is always 2
+       sound->samples_played += mix_length / 2;
 }
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]