From 77e31f1fb1065b995db8179d6016939b7be02462 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 30 Apr 2019 11:37:36 -0400 Subject: [PATCH] fix race condition after media player shutdown fixes #764 Change-Id: I6e729170b95c4320e5b500e9e3bb11cb2a788b40 --- daemon/media_player.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/daemon/media_player.c b/daemon/media_player.c index 853c145cf..236775409 100644 --- a/daemon/media_player.c +++ b/daemon/media_player.c @@ -279,6 +279,9 @@ found: // appropriate lock must be held static void media_player_read_packet(struct media_player *mp) { + if (!mp->fmtctx) + return; + int ret = av_read_frame(mp->fmtctx, &mp->pkt); if (ret < 0) { if (ret == AVERROR_EOF) {