media: ptsserv: set pts_us64 in pts_lookup_offset

PD#170127: media: ptsserv: set pts_us64 in pts_lookup_offset

Setiting pts_us64 prevents the decoder from using uninitialized values,
Sometimes the function return pts valid only if pts is set.

Change-Id: If4b0a329bbc013902fd2045207420f0f85bfff4e
Signed-off-by: rongrong zhou <rongrong.zhou@amlogic.com>
This commit is contained in:
rongrong zhou
2018-07-20 14:11:16 +08:00
committed by Yixun Lan
parent 93ff2f4d51
commit 3319c45585

View File

@@ -65,6 +65,7 @@ struct pts_table_s {
u32 lookup_cache_offset;
bool lookup_cache_valid;
u32 lookup_cache_pts;
u64 lookup_cache_pts_uS64;
unsigned long buf_start;
u32 buf_size;
int first_checkin_pts;
@@ -686,6 +687,7 @@ static int pts_lookup_offset_inline_locked(u8 type, u32 offset, u32 *val,
if ((pTable->lookup_cache_valid) &&
(offset == pTable->lookup_cache_offset)) {
*val = pTable->lookup_cache_pts;
*uS64 = pTable->lookup_cache_pts_uS64;
return 0;
}
@@ -803,6 +805,7 @@ static int pts_lookup_offset_inline_locked(u8 type, u32 offset, u32 *val,
#endif
pTable->lookup_cache_pts = *val;
pTable->lookup_cache_pts_uS64 = *uS64;
pTable->lookup_cache_offset = offset;
pTable->lookup_cache_valid = true;
@@ -899,8 +902,8 @@ static int pts_lookup_offset_inline_locked(u8 type, u32 offset, u32 *val,
p->val);
}
}
return 0;
}
return 0;
}
#endif
else {
@@ -910,6 +913,7 @@ static int pts_lookup_offset_inline_locked(u8 type, u32 offset, u32 *val,
*/
if (!pTable->first_lookup_ok) {
*val = pTable->first_checkin_pts;
*uS64 = (u64)(*val) << 32;
pTable->first_lookup_ok = 1;
pTable->first_lookup_is_fail = 1;