From: Hui Zhang Date: Wed, 11 Nov 2020 01:40:43 +0000 (+0800) Subject: h265: some special case video freeze in playback [1/1] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9162b350f0054f906820e6f9f1d795a48a97fed9;p=GitHub%2FLineageOS%2FG12%2Fandroid_hardware_amlogic_kernel-modules_media.git h265: some special case video freeze in playback [1/1] PD#SWPL-36642 Problem: some h265 stream has more reference, and offset is big, video playback freeze easily, no buffer vailable to decode Solution: change condition to use sps_max_dec_buf to cal max_buf_num Verify: S905X3 Signed-off-by: Hui Zhang Change-Id: I954e1491b88b695072000574206aa487c6c034a0 --- diff --git a/drivers/frame_provider/decoder/h265/vh265.c b/drivers/frame_provider/decoder/h265/vh265.c index df572ff..0a23180 100644 --- a/drivers/frame_provider/decoder/h265/vh265.c +++ b/drivers/frame_provider/decoder/h265/vh265.c @@ -3478,7 +3478,7 @@ static int get_work_pic_num(struct hevc_state_s *hevc) "save buf _mode : dynamic_buf_num_margin %d ----> %d \n", dynamic_buf_num_margin, hevc->dynamic_buf_num_margin); - if (sps_pic_buf_diff >= 4) + if (sps_pic_buf_diff >= 3) used_buf_num += sps_pic_buf_diff; if (hevc->is_used_v4l) { @@ -14020,7 +14020,6 @@ static int ammvdec_h265_probe(struct platform_device *pdev) &config_val) == 0) { hevc->max_pic_h = config_val; } - if (get_config_int(pdata->config, "sidebind_type", &config_val) == 0) hevc->sidebind_type = config_val; @@ -14068,11 +14067,12 @@ static int ammvdec_h265_probe(struct platform_device *pdev) hevc->double_write_mode = 0x1000; if (!hevc->is_used_v4l) { + /* get valid double write from configure or node */ + //hevc->double_write_mode = get_double_write_mode(hevc); if (hevc->save_buffer_mode && dynamic_buf_num_margin > 2) hevc->dynamic_buf_num_margin = dynamic_buf_num_margin -2; else hevc->dynamic_buf_num_margin = dynamic_buf_num_margin; - hevc->mem_map_mode = mem_map_mode; }