gint i;
/* Register callback on the buffer queue */
- result = (*thiz->bufferQueue)->RegisterCallback (thiz->bufferQueue,
- _opensles_recorder_cb, rb);
- if (result != SL_RESULT_SUCCESS) {
- GST_ERROR_OBJECT (thiz, "bufferQueue.RegisterCallback failed(0x%08x)",
- (guint32) result);
- return FALSE;
+ if (!thiz->is_queue_callback_registered) {
+ result = (*thiz->bufferQueue)->RegisterCallback (thiz->bufferQueue,
+ _opensles_recorder_cb, rb);
+ if (result != SL_RESULT_SUCCESS) {
+ GST_ERROR_OBJECT (thiz, "bufferQueue.RegisterCallback failed(0x%08x)",
+ (guint32) result);
+ return FALSE;
+ }
+ thiz->is_queue_callback_registered = TRUE;
}
/* Fill the queue by enqueing buffers */
(guint32) result);
return FALSE;
}
+ thiz->is_queue_callback_registered = FALSE;
/* Reset the queue */
result = (*thiz->bufferQueue)->Clear (thiz->bufferQueue);
gint i;
/* Register callback on the buffer queue */
- result = (*thiz->bufferQueue)->RegisterCallback (thiz->bufferQueue,
- _opensles_player_cb, rb);
- if (result != SL_RESULT_SUCCESS) {
- GST_ERROR_OBJECT (thiz, "bufferQueue.RegisterCallback failed(0x%08x)",
- (guint32) result);
- return FALSE;
+ if (!thiz->is_queue_callback_registered) {
+ result = (*thiz->bufferQueue)->RegisterCallback (thiz->bufferQueue,
+ _opensles_player_cb, rb);
+ if (result != SL_RESULT_SUCCESS) {
+ GST_ERROR_OBJECT (thiz, "bufferQueue.RegisterCallback failed(0x%08x)",
+ (guint32) result);
+ return FALSE;
+ }
+ thiz->is_queue_callback_registered = TRUE;
}
/* Fill the queue by enqueing buffers */
(guint32) result);
return FALSE;
}
+ thiz->is_queue_callback_registered = FALSE;
/* Reset the queue */
result = (*thiz->bufferQueue)->Clear (thiz->bufferQueue);
}
g_atomic_int_set (&thiz->segqueued, 0);
+ thiz->cursor = 0;
return TRUE;
}
thiz->outputMixObject = NULL;
thiz->playerObject = NULL;
thiz->recorderObject = NULL;
+ thiz->is_queue_callback_registered = FALSE;
}