Ticket #9404: still-frame-race-condition.patch

File still-frame-race-condition.patch, 2.0 KB (added by linux@…, 9 years ago)

fix for DVD player still frame race condition

  • mythtv/libs/libmythtv/mythdvdplayer.cpp

    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) 
    124124    if (player_ctx->buffer->DVD()->DVDWaitingForPlayer())
    125125    {
    126126        VERBOSE(VB_PLAYBACK, LOC + "Clearing Mythtv dvd wait state");
     127        bool inStillFrame = player_ctx->buffer->DVD()->IsInStillFrame();
    127128        player_ctx->buffer->DVD()->SkipDVDWaitingForPlayer();
    128129        ClearAfterSeek(true);
    129         if (!player_ctx->buffer->DVD()->IsInStillFrame() && videoPaused)
     130        if (!inStillFrame && videoPaused)
    130131            UnpauseVideo();
    131132        return !IsErrored();
    132133    }
    bool MythDVDPlayer::VideoLoop(void) 
    138139        if (player_ctx->buffer->DVD()->IsWaiting())
    139140        {
    140141            VERBOSE(VB_PLAYBACK, LOC + "Clearing DVD wait state");
     142            bool inStillFrame = player_ctx->buffer->DVD()->IsInStillFrame();
    141143            player_ctx->buffer->DVD()->WaitSkip();
    142             if (!player_ctx->buffer->DVD()->IsInStillFrame() && videoPaused)
     144            if (!inStillFrame && videoPaused)
    143145                UnpauseVideo();
    144146            return !IsErrored();
    145147        }