libdvr: pause recording does not work [1/1]
PD#SWPL-159304
PD#OTT-56390
Problem:
Pause recording does not work.
Solution:
Discard coming data when recording is paused.
Verify:
Tested pass on ohm
Signed-off-by: Wentao.MA <wentao.ma@amlogic.com>
Change-Id: I219c73f2e228dff62280b282f43c420d7a14118b
diff --git a/src/dvr_record.c b/src/dvr_record.c
index 07ae618..3d4f612 100644
--- a/src/dvr_record.c
+++ b/src/dvr_record.c
@@ -342,11 +342,6 @@
while (p_ctx->state == DVR_RECORD_STATE_STARTED ||
p_ctx->state == DVR_RECORD_STATE_PAUSE) {
- if (p_ctx->state == DVR_RECORD_STATE_PAUSE) {
- //wait resume record
- usleep(20*1000);
- continue;
- }
gettimeofday(&t1, NULL);
/* data from dmx, normal dvr case */
@@ -373,6 +368,11 @@
//DVR_INFO("%s, start_read error", __func__);
continue;
}
+ if (p_ctx->state == DVR_RECORD_STATE_PAUSE) {
+ //wait resume record
+ usleep(20*1000);
+ continue;
+ }
gettimeofday(&t2, NULL);
guarded_size_exceeded = DVR_FALSE;