From 56565721af5697a51da0efc9268ae3893f9a5e29 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 4 Nov 2001 10:47:37 +0100 Subject: [PATCH] Fixed ejecting a DVD while it is being replayed --- HISTORY | 3 ++- menu.c | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/HISTORY b/HISTORY index 5a75e495..07688229 100644 --- a/HISTORY +++ b/HISTORY @@ -831,7 +831,7 @@ Video Disk Recorder Revision History - Fixed handling trick modes near the beginning and end of a recording. - Pressing the "Back" button while replaying a DVD now leads to the DVD menu. -2001-11-03: Version 0.98 +2001-11-04: Version 0.98 - Completed storing the current audio volume in the setup.conf file (thanks to Andy Grobb). @@ -859,3 +859,4 @@ Video Disk Recorder Revision History - Added a fifth parameter to the 'shutdown' call that indicates the reason for this shutdown request (see INSTALL). - Fixed releasing 'index' memory after recording or playback. +- Fixed ejecting a DVD while it is being replayed. diff --git a/menu.c b/menu.c index a4a683b9..154f66cf 100644 --- a/menu.c +++ b/menu.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menu.c 1.138 2001/10/28 17:06:34 kls Exp $ + * $Id: menu.c 1.139 2001/11/04 10:37:18 kls Exp $ */ #include "menu.h" @@ -1937,6 +1937,14 @@ eOSState cMenuMain::ProcessKey(eKeys Key) #ifdef DVDSUPPORT case kYellow: if (!HasSubMenu()) { if (cDVD::DiscOk()) { + // We need to stop replaying a DVD before ejecting, + // otherwise the replay thread crashes. Currently + // checking LastReplayed() is pretty much the only way + // of finding out whether we are currently replaying a DVD + // (i.e. if LastReplayed() returns non-NULL, we are either + // replaying a normal recording, or nothing at all): + if (!cReplayControl::LastReplayed()) + cDvbApi::PrimaryDvbApi->StopReplay(); cDVD::Eject(); state = osEnd; }