From 003e130f79b5de2177381c8258080980b2cf85f5 Mon Sep 17 00:00:00 2001
From: pixel <pixel>
Date: Sat, 5 Nov 2005 14:36:11 +0000
Subject: Fixing Dalos a bit, and fixing DVD support.

---
 lib/dvdabstract.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

(limited to 'lib')

diff --git a/lib/dvdabstract.cpp b/lib/dvdabstract.cpp
index 582ad90..55a961a 100644
--- a/lib/dvdabstract.cpp
+++ b/lib/dvdabstract.cpp
@@ -17,7 +17,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-/* $Id: dvdabstract.cpp,v 1.1 2005-11-02 21:34:02 pixel Exp $ */
+/* $Id: dvdabstract.cpp,v 1.2 2005-11-05 14:36:12 pixel Exp $ */
 
 #include "dvdabstract.h"
 
@@ -116,7 +116,7 @@ ssize_t dvdabstract::write(const void * _buf, size_t count) throw (GeneralExcept
     
     reminder = i_count;
     memcpy(i_buf, buf, reminder);
-    if (reminder >= 0) {
+    if (reminder > 0) {
 	memcpy(buf, i_buf, reminder);
 	if (reminder <= 22) {
 	    if (reminder <= 15) {
@@ -144,6 +144,7 @@ void dvdabstract::read_sector(char * buf, int sector) {
 }
 
 void dvdabstract::write_sector(const char * buf, int sector) throw (GeneralException) {
+    if (sector > 913000) printm(M_BARE, "sector %i.\n", sector);
     r->seek(sector * 2048);
     switch(buf[15]) {
     case 0:
@@ -151,10 +152,10 @@ void dvdabstract::write_sector(const char * buf, int sector) throw (GeneralExcep
 	r->write(buf + 16, 2048);
 	break;
     case 2:
-	if ((buf[18] == 1) && (buf[22] == 1)) {
+	if (((buf[18] & 8) && (buf[22] & 8)) || (!buf[16] && !buf[17] && !buf[18] && !buf[19] && !buf[20] && !buf[21] && !buf[22] && !buf[23])) {
 	    r->write(buf + 24, 2048);
 	    break;
-	}
+        }
     default:
 	throw GeneralException("dvdabstract::write_sector: unknown sector mode.");
     }
-- 
cgit v1.2.3