summaryrefslogtreecommitdiffstats
path: root/stream/stream_dvd.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-12-31 14:21:50 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-12-31 14:21:50 +0000
commita2c2268cdf6a2c5140084d61000144123f325ee3 (patch)
tree046431440563d27fe0100c0937f866d2f2bc65ab /stream/stream_dvd.c
parent80cf4355292d1975018d7d449520530293b985f4 (diff)
downloadmpv-a2c2268cdf6a2c5140084d61000144123f325ee3.tar.bz2
mpv-a2c2268cdf6a2c5140084d61000144123f325ee3.tar.xz
Work around a dvdread bug where DVDReadBlocks would return values < 0 on read error,
causing hangs e.g. when seeking to the very last chapter (which would read beyond the size of the DVD). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28216 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream/stream_dvd.c')
-rw-r--r--stream/stream_dvd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c
index ec0b7983c8..235586597a 100644
--- a/stream/stream_dvd.c
+++ b/stream/stream_dvd.c
@@ -364,7 +364,8 @@ read_next:
}
len = DVDReadBlocks(d->title, d->cur_pack, 1, data);
- if(!len) return -1; //error
+ // only == 0 should indicate an error, but some dvdread version are buggy when used with dvdcss
+ if(len <= 0) return -1; //error
if(data[38]==0 && data[39]==0 && data[40]==1 && data[41]==0xBF &&
data[1024]==0 && data[1025]==0 && data[1026]==1 && data[1027]==0xBF) {