void *ptr = NULL;
ptr = pa_memblock_acquire(chunk->memblock);
- if (ptr)
+ if (ptr) {
+ i->dump_length = chunk->length;
fwrite((uint8_t *)ptr + chunk->index, 1, chunk->length, i->pcm_dump_fp);
- else
+ } else {
+ i->dump_length = 0;
pa_log_warn("pa_memblock_acquire is failed. ptr is NULL");
+ }
pa_memblock_release(chunk->memblock);
}
}
#ifdef ENABLE_PCM_DUMP
i->pcm_dump_fp = NULL;
i->dump_path = NULL;
+ i->dump_length = 0;
#endif
#endif
if (data->flags & PA_SINK_INPUT_START_RAMP_MUTED)
#ifdef SINK_INPUT_DEBUG
pa_log_debug("dropping %lu", (unsigned long) nbytes);
#endif
+#ifdef __TIZEN__
+ if (i->pcm_dump_fp && i->dump_length) {
+ int64_t seek_length;
+ seek_length = (int64_t) (nbytes - i->dump_length);
+
+ if (seek_length < 0)
+ fseeko(i->pcm_dump_fp, (off_t)seek_length, SEEK_CUR);
+
+ i->dump_length = 0;
+ }
+#endif
pa_memblockq_drop(i->thread_info.render_memblockq, nbytes);
}