From 55a6daddbb3e2379ed04dd017845a10978b5f778 Mon Sep 17 00:00:00 2001 From: Sain Wu Date: Sat, 5 Jun 2021 16:54:54 +0800 Subject: [PATCH] #5272 fix(ijkplayer) shutdown add lock --- ijkmedia/ijkplayer/ijkplayer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ijkmedia/ijkplayer/ijkplayer.c b/ijkmedia/ijkplayer/ijkplayer.c index 8ea4d4748e..c8355b17e5 100755 --- a/ijkmedia/ijkplayer/ijkplayer.c +++ b/ijkmedia/ijkplayer/ijkplayer.c @@ -299,10 +299,12 @@ void ijkmp_shutdown_l(IjkMediaPlayer *mp) assert(mp); MPTRACE("ijkmp_shutdown_l()\n"); + pthread_mutex_lock(&mp->mutex); if (mp->ffplayer) { ffp_stop_l(mp->ffplayer); ffp_wait_stop_l(mp->ffplayer); } + pthread_mutex_unlock(&mp->mutex); MPTRACE("ijkmp_shutdown_l()=void\n"); }