dvr: [vmx-dvb]PVR function not available [1/1]
PD#SWPL-23197
Problem:
[vmx-dvb]PVR function not available.
Solution:
1. add rec test code.
2. start audio when resume if has valid audio pid.
3. need check has video or has audio when pause stop resume.
4. add set sec buf and cb function.
5. fixed update segment error.check list is NULL.
Verify:
Android Q + AC214
Signed-off-by: hualing chen <hualing.chen@amlogic.com>
Change-Id: I25c46a1fd96a512a20e893d606587e5414ad7e40
diff --git a/src/segment.c b/src/segment.c
index 4efe0b2..c002b0d 100644
--- a/src/segment.c
+++ b/src/segment.c
@@ -241,7 +241,7 @@
return DVR_SUCCESS;
}
-loff_t segment_seek(Segment_Handle_t handle, uint64_t time)
+loff_t segment_seek(Segment_Handle_t handle, uint64_t time, int block_size)
{
Segment_Context_t *p_ctx;
char buf[256];
@@ -255,6 +255,13 @@
DVR_RETURN_IF_FALSE(p_ctx->index_fp);
DVR_RETURN_IF_FALSE(p_ctx->ts_fd != -1);
+ if (time == 0) {
+ offset = 0;
+ DVR_DEBUG(1, "seek time=%llu, offset=%lld time--%llu\n", pts, offset, time);
+ DVR_RETURN_IF_FALSE(lseek64(p_ctx->ts_fd, offset, SEEK_SET) != -1);
+ return offset;
+ }
+
memset(buf, 0, sizeof(buf));
DVR_RETURN_IF_FALSE(fseek(p_ctx->index_fp, 0, SEEK_SET) != -1);
int line = 0;
@@ -285,6 +292,9 @@
memset(buf, 0, sizeof(buf));
//DVR_DEBUG(1, "seek time=%llu, offset=%lld\n", pts, offset);
if (time <= pts) {
+ if (block_size > 0) {
+ offset = offset - offset%block_size;
+ }
DVR_DEBUG(1, "seek time=%llu, offset=%lld time--%llu line %d\n", pts, offset, time, line);
DVR_RETURN_IF_FALSE(lseek64(p_ctx->ts_fd, offset, SEEK_SET) != -1);
return offset;