From e41755553bc6973c54e0f77b8e60c0f1ffa149e4 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 20 Jun 2014 19:24:42 +0200 Subject: stream_dvd: fix potential endless loop on seeking Attempt to fix a reported freeze with some DVDs. Unknown if this helps, and it still might read the whole DVD before terminating. --- stream/stream_dvd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c index d67f14a5c1..a63cc41f75 100644 --- a/stream/stream_dvd.c +++ b/stream/stream_dvd.c @@ -484,7 +484,8 @@ static int dvd_seek_to_time(stream_t *stream, ifo_handle_t *vts_file, double sec do_seek(stream, pos); do { char buf[2048]; - dvd_read_sector(stream, stream->priv, buf); // skip + if (dvd_read_sector(stream, stream->priv, buf) < 0) // skip + break; t = mp_dvdtimetomsec(&d->dsi_pack.dsi_gi.c_eltm); } while(!t); tm = dvd_get_current_time(stream, -1); -- cgit v1.2.3