that the internal mutex is released correctly and new data overwrites
older data when an overrun occurs and writing is not blocked.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@6145
221aa14e-8319-0410-a670-
987f0aec2ac5
"audio_osx_source::audio_osx_source");
#if _OSX_AU_DEBUG_
"audio_osx_source::audio_osx_source");
#if _OSX_AU_DEBUG_
- fprintf (stderr, "---- Device Stream Format ----\n" );
+ fprintf (stderr, "\n---- Device Stream Format ----\n" );
PrintStreamDesc (&asbd_device);
#endif
PrintStreamDesc (&asbd_device);
#endif
"audio_osx_source::audio_osx_source");
#if _OSX_AU_DEBUG_
"audio_osx_source::audio_osx_source");
#if _OSX_AU_DEBUG_
- fprintf (stderr, "---- Client Stream Format ----\n");
+ fprintf (stderr, "\n---- Client Stream Format ----\n");
PrintStreamDesc (&asbd_client);
#endif
PrintStreamDesc (&asbd_client);
#endif
while (--l_counter >= 0) {
float* inBuffer = (float*) This->d_OutputBuffer->mBuffers[l_counter].mData;
while (--l_counter >= 0) {
float* inBuffer = (float*) This->d_OutputBuffer->mBuffers[l_counter].mData;
+
+#if _OSX_AU_DEBUG_
+ fprintf (stderr, "cb2.5: enqueuing audio data.\n");
+#endif
+
int l_res = This->d_buffers[l_counter]->enqueue (inBuffer, ActualOutputFrames);
if (l_res == -1)
res = -1;
int l_res = This->d_buffers[l_counter]->enqueue (inBuffer, ActualOutputFrames);
if (l_res == -1)
res = -1;
- fprintf (stderr, "cb5: #OI = %4ld, #Cnt = %4ld, mSC = %ld, \n",
+ fprintf (stderr, "cb3: #OI = %4ld, #Cnt = %4ld, mSC = %ld, \n",
ActualOutputFrames, This->d_queueSampleCount,
This->d_max_sample_count);
#endif
ActualOutputFrames, This->d_queueSampleCount,
This->d_max_sample_count);
#endif
// signal that data is available, if appropraite
This->d_cond_data->signal ();
// signal that data is available, if appropraite
This->d_cond_data->signal ();
+#if _OSX_AU_DEBUG_
+ fprintf (stderr, "cb4: releasing internal mutex.\n");
+#endif
+
// release control to allow for other processing parts to run
This->d_internal->post ();
// release control to allow for other processing parts to run
This->d_internal->post ();
+#if _OSX_AU_DEBUG_
+ fprintf (stderr, "cb5: returning.\n");
+#endif
+
d_internal->unlock ();
return (2);
}
d_internal->unlock ();
return (2);
}
+ // set the return value to 1: success; change if needed
+ int retval = 1;
if (bufLen_I > d_n_avail_write_I) {
if (d_doWriteBlock) {
while (bufLen_I > d_n_avail_write_I) {
if (bufLen_I > d_n_avail_write_I) {
if (d_doWriteBlock) {
while (bufLen_I > d_n_avail_write_I) {
#if DO_DEBUG
fprintf (stderr, "circular_buffer::enqueue: overflow\n");
#endif
#if DO_DEBUG
fprintf (stderr, "circular_buffer::enqueue: overflow\n");
#endif
}
}
UInt32 n_now_I = d_bufLen_I - d_writeNdx_I, n_start_I = 0;
}
}
UInt32 n_now_I = d_bufLen_I - d_writeNdx_I, n_start_I = 0;
d_n_avail_write_I -= bufLen_I;
d_readBlock->signal ();
d_internal->unlock ();
d_n_avail_write_I -= bufLen_I;
d_readBlock->signal ();
d_internal->unlock ();