mirror of
https://github.com/mpv-player/mpv
synced 2025-03-23 03:37:27 +00:00
make fail STREAM_CTRLs related to seeking/fetching time/chapter when the cache is enabled: they can't work atm
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20856 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
5c361eff9d
commit
61f29af978
@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
#include "stream_dvd.h"
|
#include "stream_dvd.h"
|
||||||
|
|
||||||
|
extern int stream_cache_size;
|
||||||
/// We keep these 2 for the gui atm, but they will be removed.
|
/// We keep these 2 for the gui atm, but they will be removed.
|
||||||
extern int dvd_title;
|
extern int dvd_title;
|
||||||
extern int dvd_chapter;
|
extern int dvd_chapter;
|
||||||
@ -643,19 +644,24 @@ static int control(stream_t *stream,int cmd,void* arg)
|
|||||||
}
|
}
|
||||||
case STREAM_CTRL_SEEK_TO_CHAPTER:
|
case STREAM_CTRL_SEEK_TO_CHAPTER:
|
||||||
{
|
{
|
||||||
int r = seek_to_chapter(stream, d->vts_file, d->tt_srpt, d->cur_title-1, *((unsigned int *)arg));
|
int r;
|
||||||
|
if(stream_cache_size > 0) return STREAM_UNSUPORTED;
|
||||||
|
r = seek_to_chapter(stream, d->vts_file, d->tt_srpt, d->cur_title-1, *((unsigned int *)arg));
|
||||||
if(! r) return STREAM_UNSUPORTED;
|
if(! r) return STREAM_UNSUPORTED;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
case STREAM_CTRL_GET_CURRENT_CHAPTER:
|
case STREAM_CTRL_GET_CURRENT_CHAPTER:
|
||||||
{
|
{
|
||||||
|
if(stream_cache_size > 0) return STREAM_UNSUPORTED;
|
||||||
*((unsigned int *)arg) = dvd_chapter_from_cell(d, d->cur_title-1, d->cur_cell);
|
*((unsigned int *)arg) = dvd_chapter_from_cell(d, d->cur_title-1, d->cur_cell);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
case STREAM_CTRL_GET_CURRENT_TIME:
|
case STREAM_CTRL_GET_CURRENT_TIME:
|
||||||
{
|
{
|
||||||
double tm = dvd_get_current_time(stream, 0);
|
double tm;
|
||||||
|
if(stream_cache_size > 0) return STREAM_UNSUPORTED;
|
||||||
|
tm = dvd_get_current_time(stream, 0);
|
||||||
if(tm != -1) {
|
if(tm != -1) {
|
||||||
tm *= 1000.0f;
|
tm *= 1000.0f;
|
||||||
*((unsigned int *)arg) = (unsigned int) tm;
|
*((unsigned int *)arg) = (unsigned int) tm;
|
||||||
@ -666,6 +672,7 @@ static int control(stream_t *stream,int cmd,void* arg)
|
|||||||
case STREAM_CTRL_SEEK_TO_TIME:
|
case STREAM_CTRL_SEEK_TO_TIME:
|
||||||
{
|
{
|
||||||
dvd_priv_t *d = stream->priv;
|
dvd_priv_t *d = stream->priv;
|
||||||
|
if(stream_cache_size > 0) return STREAM_UNSUPORTED;
|
||||||
if(dvd_seek_to_time(stream, d->vts_file, *((double*)arg)))
|
if(dvd_seek_to_time(stream, d->vts_file, *((double*)arg)))
|
||||||
return 1;
|
return 1;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user