PD#SWPL-24587
Problem:
1. when one package have more frame, some buf handle is 0
at start one package and lastest buf is valid, so when
get freed handle often get invalid duo to apk do not have
input buf enough and drop frame
2. next pts often is 0, duo to video check parten error
Solution:
1. get freed handle only retrun no-zero handle
2. if next pts is 0, use current pts add duration
Verify:
verify on TM2.
Change-Id: I4f9f0b30e66621bce76a66d093a2d5334583020f
Signed-off-by: Jian Wang <jian.wang@amlogic.com>
return 0;
flags = vdec_input_lock(input);
- block = list_first_entry_or_null(&input->vframe_block_free_list,
+ do {
+ block = list_first_entry_or_null(&input->vframe_block_free_list,
struct vframe_block_list_s, list);
+ if (!block) {
+ break;
+ }
- if (block) {
handle = block->handle;
vdec_input_del_block_locked(input, block);
kfree(block);
- }
+
+ } while(!handle);
+
vdec_input_unlock(input, flags);
return handle;
}
if (vf->pts != 0)
hw->last_lookup_pts = vf->pts;
+ if (hw->frame_dur && ((vf->pts == 0) || (vf->pts_us64 == 0))) {
+ vf->pts = hw->last_pts + DUR2PTS(hw->frame_dur);
+ vf->pts_us64 = hw->last_pts_us64 +
+ (DUR2PTS(hw->frame_dur) * 100 / 9);
+ }
if ((hw->pts_mode == PTS_NONE_REF_USE_DURATION)
&& (slice_type != KEY_FRAME))