1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-25 08:12:17 +00:00

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
This commit is contained in:
nicodvb 2006-09-18 21:12:22 +00:00
parent ac4703fc35
commit aa278680ac

View File

@ -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;
}
}