Update of /cvsroot/playerstage/code/player/server/drivers/audio
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32031

Modified Files:
        alsa.cc 
Log Message:
Thanks to Lorenz for the following update:
- added some checks for null pointers before calling strdup in Alsa::Alsa on 
initialization.
- added one check for null pointer before using the playback pcm handle in 
cleanup code to keep the player server running after disconnect.
- the buffer is no longer filled to its maximal size but to the size specified 
by the  rec_bufferlength config key so that a higher data rate is possible.



Index: alsa.cc
===================================================================
RCS file: /cvsroot/playerstage/code/player/server/drivers/audio/alsa.cc,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** alsa.cc     24 Aug 2006 00:28:14 -0000      1.6
--- alsa.cc     4 Sep 2006 11:53:56 -0000       1.7
***************
*** 152,156 ****
  @endverbatim
  
! @author Geoffrey Biggs
   */
  /** @} */
--- 152,156 ----
  @endverbatim
  
! @author Geoffrey Biggs, Lorenz Moesenlechner
   */
  /** @} */
***************
*** 1041,1045 ****
                        totalRead += framesRead;
                        // If this buffer is full, publish the data (resetting 
the buffer to zero)
!                       if (recData->data_count == PLAYER_AUDIO_WAV_BUFFER_SIZE)
                                PublishRecordedData ();
                }
--- 1041,1045 ----
                        totalRead += framesRead;
                        // If this buffer is full, publish the data (resetting 
the buffer to zero)
!                       if (recData->data_count >= ((recSampleRate * 
cfgRecBufferTime)/1000) * recNumChannels * recBits/8)
                                PublishRecordedData ();
                }
***************
*** 1106,1110 ****
        playState = PB_STATE_STOPPED;
        // Drop anything currently in the buffer and stop the card
!       snd_pcm_drop (pbHandle);
  
        // Update clients about state
--- 1106,1111 ----
        playState = PB_STATE_STOPPED;
        // Drop anything currently in the buffer and stop the card
!     if( pbHandle )
!         snd_pcm_drop (pbHandle);
  
        // Update clients about state
***************
*** 1761,1771 ****
        pbFDs = recFDs = NULL;
        recData = NULL;
  
        // Read the config file options - see header for descriptions if not 
here
        useQueue = cf->ReadBool (section, "usequeue", true);
!       pbDevice = strdup (cf->ReadString (section, "pbdevice", NULL));
!       mixerDevice = strdup (cf->ReadString (section, "mixerdevice", NULL));
!       recDevice = strdup (cf->ReadString (section, "recdevice", NULL));
!       cfgPBPeriodTime = cf->ReadInt (section, "pb_periodlength", 50);
        cfgPBBufferTime = cf->ReadInt (section, "pb_bufferlength", 500);
        // Don't have silence if not using the queue system
--- 1762,1782 ----
        pbFDs = recFDs = NULL;
        recData = NULL;
+     const char *str;
  
        // Read the config file options - see header for descriptions if not 
here
        useQueue = cf->ReadBool (section, "usequeue", true);
!     str = cf->ReadString (section, "pbdevice", NULL);
!     if( str )
!         pbDevice = strdup(str);
!     
!     str = cf->ReadString (section, "mixerdevice", NULL);
!     if( str )
!           mixerDevice = strdup ( str );
! 
!     str = cf->ReadString (section, "recdevice", NULL);
!     if( str )
!         recDevice = strdup (str);
! 
!     cfgPBPeriodTime = cf->ReadInt (section, "pb_periodlength", 50);
        cfgPBBufferTime = cf->ReadInt (section, "pb_bufferlength", 500);
        // Don't have silence if not using the queue system


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to