summaryrefslogtreecommitdiffstats
path: root/stream/stream_dvdnav.c
diff options
context:
space:
mode:
authornicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-09-18 21:12:22 +0000
committernicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-09-18 21:12:22 +0000
commitaa278680acc1678ac2040769e5d7dead40d6affb (patch)
tree2951604e98afcc5019c59a3fccbf648671000db0 /stream/stream_dvdnav.c
parentac4703fc35de1e3e06fab8df32a8f00876944ac5 (diff)
downloadmpv-aa278680acc1678ac2040769e5d7dead40d6affb.tar.bz2
mpv-aa278680acc1678ac2040769e5d7dead40d6affb.tar.xz
don't seek until dvdnav_get_position() returns something meaningful
(len > 0), or dvdnav may crash or complain. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19898 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream/stream_dvdnav.c')
-rw-r--r--stream/stream_dvdnav.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c
index 16da6bfc30..4be07a0823 100644
--- a/stream/stream_dvdnav.c
+++ b/stream/stream_dvdnav.c
@@ -51,6 +51,8 @@ int osd_show_dvd_nav_sy;
int osd_show_dvd_nav_ey;
int dvd_nav_still=0; /* are we on a still picture? */
+static int seek(stream_t *s, off_t newpos);
+
dvdnav_priv_t * new_dvdnav_stream(char * filename) {
char * title_str;
dvdnav_priv_t *dvdnav_priv;
@@ -248,8 +250,13 @@ static void update_title_len(stream_t *stream) {
uint32_t pos = 0, len = 0;
status = dvdnav_get_position(priv->dvdnav, &pos, &len);
- if(status == DVDNAV_STATUS_OK && len)
+ if(status == DVDNAV_STATUS_OK && len) {
stream->end_pos = (off_t) len * 2048;
+ stream->seek = seek;
+ } else {
+ stream->seek = NULL;
+ stream->end_pos = 0;
+ }
}