From 14938a59fb5f4403bb1302aae5a7d4c27a729be9 Mon Sep 17 00:00:00 2001
From: Martin Kittel <linux@martin-kittel.de>
Date: Wed, 22 Dec 2010 21:03:31 +0100
Subject: [PATCH] Fix race condition when navigating away/skipping from still frame
When navigating away from a still frame the dvd read thread was continuing
before checking whether we were in still frame. When navigating to a menu
the dvd read thread could by that time already have advanced to the menu and
the IsInStillFrame would return false.
In this case the menu animation would flicker as the 'videoPaused' flag would
still be set until the timeout for the still frame had been reached.
---
mythtv/libs/libmythtv/mythdvdplayer.cpp | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/mythtv/libs/libmythtv/mythdvdplayer.cpp b/mythtv/libs/libmythtv/mythdvdplayer.cpp
index e63f689..53e1603 100644
a
|
b
|
bool MythDVDPlayer::VideoLoop(void) |
124 | 124 | if (player_ctx->buffer->DVD()->DVDWaitingForPlayer()) |
125 | 125 | { |
126 | 126 | VERBOSE(VB_PLAYBACK, LOC + "Clearing Mythtv dvd wait state"); |
| 127 | bool inStillFrame = player_ctx->buffer->DVD()->IsInStillFrame(); |
127 | 128 | player_ctx->buffer->DVD()->SkipDVDWaitingForPlayer(); |
128 | 129 | ClearAfterSeek(true); |
129 | | if (!player_ctx->buffer->DVD()->IsInStillFrame() && videoPaused) |
| 130 | if (!inStillFrame && videoPaused) |
130 | 131 | UnpauseVideo(); |
131 | 132 | return !IsErrored(); |
132 | 133 | } |
… |
… |
bool MythDVDPlayer::VideoLoop(void) |
138 | 139 | if (player_ctx->buffer->DVD()->IsWaiting()) |
139 | 140 | { |
140 | 141 | VERBOSE(VB_PLAYBACK, LOC + "Clearing DVD wait state"); |
| 142 | bool inStillFrame = player_ctx->buffer->DVD()->IsInStillFrame(); |
141 | 143 | player_ctx->buffer->DVD()->WaitSkip(); |
142 | | if (!player_ctx->buffer->DVD()->IsInStillFrame() && videoPaused) |
| 144 | if (!inStillFrame && videoPaused) |
143 | 145 | UnpauseVideo(); |
144 | 146 | return !IsErrored(); |
145 | 147 | } |