comparison stream/stream_dvd.c @ 20851:6602a90a06ec

consistency fix: STREAM_CTRL_GET_TIME_LENGTH and STREAM_CTRL_GET_CURRENT_TIME now return time in (double) seconds
author nicodvb
date Sun, 12 Nov 2006 17:19:56 +0000
parents 70b6f88bd23c
children 77ec48709f36
comparison
equal deleted inserted replaced
20850:fa032dca75f8 20851:6602a90a06ec
631 dvd_priv_t *d = stream->priv; 631 dvd_priv_t *d = stream->priv;
632 switch(cmd) 632 switch(cmd)
633 { 633 {
634 case STREAM_CTRL_GET_TIME_LENGTH: 634 case STREAM_CTRL_GET_TIME_LENGTH:
635 { 635 {
636 *((unsigned int *)arg) = mp_get_titleset_length(d->vts_file, d->tt_srpt, d->cur_title-1); 636 *((double *)arg) = (double) mp_get_titleset_length(d->vts_file, d->tt_srpt, d->cur_title-1)/1000.0;
637 return 1; 637 return 1;
638 } 638 }
639 case STREAM_CTRL_GET_NUM_CHAPTERS: 639 case STREAM_CTRL_GET_NUM_CHAPTERS:
640 { 640 {
641 if(! d->cur_pgc->nr_of_programs) return STREAM_UNSUPORTED; 641 if(! d->cur_pgc->nr_of_programs) return STREAM_UNSUPORTED;
661 { 661 {
662 double tm; 662 double tm;
663 if(stream_cache_size > 0) return STREAM_UNSUPORTED; 663 if(stream_cache_size > 0) return STREAM_UNSUPORTED;
664 tm = dvd_get_current_time(stream, 0); 664 tm = dvd_get_current_time(stream, 0);
665 if(tm != -1) { 665 if(tm != -1) {
666 tm *= 1000.0f; 666 *((double *)arg) = tm;
667 *((unsigned int *)arg) = (unsigned int) tm;
668 return 1; 667 return 1;
669 } 668 }
670 break; 669 break;
671 } 670 }
672 case STREAM_CTRL_SEEK_TO_TIME: 671 case STREAM_CTRL_SEEK_TO_TIME: