if ((chunk.length = pa_usec_to_bytes(now - u->timestamp, &u->source->sample_spec)) > 0) {
chunk.memblock = pa_memblock_new(u->core->mempool, (size_t) -1); /* or chunk.length? */
+#ifdef __TIZEN__
+ /* Sometimes calculated chunk.length is larger than the block size of mempool when -1 is given for size input.
+ Following code will realloc with actual calculated size again to prevent assert error during pa_source_post() */
+ if (chunk.length > pa_memblock_get_length(chunk.memblock)) {
+ pa_log_warn("Exception occurs!! chunk.length(%d) > memblock_length(%d), do memblock_new() with actual length again",
+ chunk.length, pa_memblock_get_length(chunk.memblock));
+
+ pa_memblock_unref(chunk.memblock);
+ chunk.memblock = pa_memblock_new(u->core->mempool, chunk.length);
+ }
+#endif
chunk.index = 0;
pa_source_post(u->source, &chunk);
pa_memblock_unref(chunk.memblock);