[Jackrtp-cvs] jackrtp/src JackSink.cpp,1.2,1.3
Status: Alpha
Brought to you by:
p_tisserand
|
From: Francois D. <dec...@us...> - 2004-08-13 15:27:30
|
Update of /cvsroot/jackrtp/jackrtp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16771/src Modified Files: JackSink.cpp Log Message: Fixed compilation error (invalid cast) Index: JackSink.cpp =================================================================== RCS file: /cvsroot/jackrtp/jackrtp/src/JackSink.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JackSink.cpp 29 Jul 2004 15:15:18 -0000 1.2 --- JackSink.cpp 13 Aug 2004 15:27:21 -0000 1.3 *************** *** 67,72 **** short sample; ! float *fsample; ! fsample = new float[1]; size_t space_for_writing = 0; size_t nbytes_write = 0; --- 67,71 ---- short sample; ! float fsample[1]; size_t space_for_writing = 0; size_t nbytes_write = 0; *************** *** 90,99 **** in audio applications we use floats in the range from [-1;1] -> so we have to divide*/ ! *fsample = static_cast<float>(sample) * fScaler16; /*and write it to the ringbuffer*/ ! nbytes_write = jack_ringbuffer_write(m_thread_info->ringbuffer, (const char*)fsample, sizeof(float)); } } ! delete[] fsample; return True; } --- 89,98 ---- in audio applications we use floats in the range from [-1;1] -> so we have to divide*/ ! fsample[0] = static_cast<float>(sample) * fScaler16; /*and write it to the ringbuffer*/ ! nbytes_write = jack_ringbuffer_write(m_thread_info->ringbuffer, reinterpret_cast<char *>(fsample), sizeof(float)); } } ! return True; } |