libdvr: Recording completely played popup appeared when rewind [1/1]
PD#OTT-53202
PD#SWPL-154110
Problem:
Playback ends unexpectedly on fast rewind.
Solution:
1. Add an additional constraint to avoid unexpected REACHED_END;
2. Remove Chinese comments to avoid encoding issue;
Verify:
Tested pass on ohm
Signed-off-by: Wentao.MA <wentao.ma@amlogic.com>
Change-Id: Ie72896adac8f33624e49aaa70b1f7e2771f1de41
diff --git a/src/dvr_playback.c b/src/dvr_playback.c
index c9217b9..c972e9a 100644
--- a/src/dvr_playback.c
+++ b/src/dvr_playback.c
@@ -322,7 +322,6 @@
{
DVR_Playback_t *player = (DVR_Playback_t *) handle;
-
if (player == NULL) {
DVR_PB_INFO("player is NULL");
return DVR_FAILURE;
@@ -330,16 +329,11 @@
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
- //ms为毫秒,换算成秒
ts.tv_sec += ms/1000;
- //在outtime的基础上,增加ms毫秒
- //outtime.tv_nsec为纳秒,1微秒=1000纳秒
- //tv_nsec此值再加上剩余的毫秒数 ms%1000,有可能超过1秒。需要特殊处理
- uint64_t us = ts.tv_nsec/1000 + 1000 * (ms % 1000); //微秒
- //us的值有可能超过1秒,
+ uint64_t us = ts.tv_nsec/1000 + 1000 * (ms % 1000);
ts.tv_sec += us / 1000000;
us = us % 1000000;
- ts.tv_nsec = us * 1000;//换算成纳秒
+ ts.tv_nsec = us * 1000;
int val = dvr_mutex_save(&player->lock);
pthread_cond_timedwait(&player->cond, &player->lock.lock, &ts);
@@ -1285,7 +1279,7 @@
continue;
}
//DVR_PB_INFO("read ts [%d]buf_len[%d]speed[%f]real_read:%d", read, buf_len, player->speed, real_read);
- if (read == 0) {
+ if (read == 0 && !IS_FB(player->speed)) {
//file end.need to play next segment
#define MIN_CACHE_TIME (3000)
int delay = 0;