From aa278680acc1678ac2040769e5d7dead40d6affb Mon Sep 17 00:00:00 2001 From: nicodvb Date: Mon, 18 Sep 2006 21:12:22 +0000 Subject: [PATCH] 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 --- stream/stream_dvdnav.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; + } }