rec: optimize for speed [1/1]

PD#SWPL-120895

Problem:
process slow

Solution:
1. remove redundant operation
2. replace pipe processes with std api

Verify:
PB

Change-Id: I9cfb6ccb8029580e7d43a348984ce1eb68e1924b
Signed-off-by: Zhiqiang Han <zhiqiang.han@amlogic.com>
diff --git a/src/dvr_wrapper.c b/src/dvr_wrapper.c
index 0bb6bc3..197bbb1 100644
--- a/src/dvr_wrapper.c
+++ b/src/dvr_wrapper.c
@@ -1235,7 +1235,8 @@
 
   //wait for the file status to stabilize before set the new segment id
   uint64_t new_segment_id = 0;
-  {
+
+  if (params->save_rec_file != 0) {
     uint32_t segment_nb = 0;
     uint64_t *p_segment_ids = NULL;
     error = dvr_segment_get_list(ctx->record.param_open.location, &segment_nb, &p_segment_ids);
@@ -1248,8 +1249,9 @@
     if (p_segment_ids != NULL) {
       free(p_segment_ids);
     }
-    DVR_WRAPPER_DEBUG("new_segment_id:%lld\n", new_segment_id);
   }
+  DVR_WRAPPER_DEBUG("new_segment_id:%lld\n", new_segment_id);
+
   ctx->record.next_segment_id = new_segment_id;
   ctx->current_segment_id = new_segment_id;