pipvideo: fix cur_pipbuf not set to NULL when disable video before unreg [1/1]
authorjintao xu <jintao.xu@amlogic.com>
Fri, 31 May 2019 06:33:13 +0000 (14:33 +0800)
committerNick Xie <nick@khadas.com>
Mon, 5 Aug 2019 06:43:00 +0000 (14:43 +0800)
PD#OTT-4262

Problem:
When disable video before unreg, cur_pipbuf will not set to NULL.
Next time playback will tog this buffer.

Solution:
Free cur_pipbuf when vd2 is closed in unreg.

Verify:
U212

Change-Id: Ie381ae9feda8a5d23a93b3a5974d9c0af87e6d6e
Signed-off-by: jintao xu <jintao.xu@amlogic.com>
drivers/amlogic/media/video_sink/video.c

index 29f0bc6..6f54df4 100644 (file)
@@ -8469,11 +8469,13 @@ static void pip_vf_unreg_provider(void)
                try_free_keep_videopip(1);
        }
 
-       if (cur_pipbuf)
+       if (cur_pipbuf && get_videopip_enabled())
                keeped = vf_keep_pip_current_locked(cur_pipbuf, NULL);
+       else if (cur_pipbuf)
+               keeped = -1;
 
        if (keeped < 0) {/*keep failed.*/
-               pr_info("videopip keep failed, disable video now!\n");
+               pr_info("videopip disable video now!\n");
                safe_disble_videolayer2();
                try_free_keep_videopip(1);
        }