diff options
author | 2013-05-03 19:52:28 +0200 | |
---|---|---|
committer | 2013-05-05 18:44:23 +0200 | |
commit | acad31c2d382043f1c43c74a678de659a54a3788 (patch) | |
tree | eb7d9a07f8ea0316e6faff2ce410fb298e50352c | |
parent | 977dc4c63df0c38d6ce34b51f97352eb3d0e91e9 (diff) |
core: don't report byte-based playback position with dvd
DVD playback uses a demuxer that signals to the frontend that timestamp
resets are possible. This made the frontend calculate the OSD playback
position based on the byte position and the total size of the stream.
This actually broke DVD playback position display. Since DVD reports a
a linear playback position, we don't have to rely on the demuxer
reported position, so disable this functionality in case of DVD
playback. This reverts the OSD behavior with DVD to the old behavior.
-rw-r--r-- | demux/demux.c | 6 | ||||
-rw-r--r-- | stream/cache2.c | 6 | ||||
-rw-r--r-- | stream/stream.c | 5 | ||||
-rw-r--r-- | stream/stream.h | 4 | ||||
-rw-r--r-- | stream/stream_dvd.c | 2 |
5 files changed, 22 insertions, 1 deletions
diff --git a/demux/demux.c b/demux/demux.c index e1bb960e78..937c881639 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -922,6 +922,10 @@ static struct demuxer *open_given_type(struct MPOpts *opts, opts->correct_pts = demux_control(demuxer, DEMUXER_CTRL_CORRECT_PTS, NULL) == DEMUXER_CTRL_OK; + if (stream_manages_timeline(demuxer->stream)) { + // Incorrect, but fixes some behavior with DVD/BD + demuxer->ts_resets_possible = false; + } demuxer_sort_chapters(demuxer); return demuxer; } else { @@ -1071,7 +1075,7 @@ int demux_seek(demuxer_t *demuxer, float rel_seek_secs, float audio_delay, * (nothing actually implements DEMUXER_CTRL_RESYNC now). */ struct stream *stream = demuxer->stream; - if (stream->type == STREAMTYPE_DVD) { + if (stream_manages_timeline(stream)) { double pts; if (flags & SEEK_ABSOLUTE) diff --git a/stream/cache2.c b/stream/cache2.c index 7744f2cba9..6c11ec9812 100644 --- a/stream/cache2.c +++ b/stream/cache2.c @@ -323,6 +323,9 @@ static int cache_execute_control(cache_vars_t *s) { case STREAM_CTRL_GET_LANG: s->control_res = s->stream->control(s->stream, s->control, (void *)&s->control_lang_arg); break; + case STREAM_CTRL_MANAGES_TIMELINE: + s->control_res = s->stream->control(s->stream, s->control, NULL); + break; default: s->control_res = STREAM_UNSUPPORTED; break; @@ -659,6 +662,7 @@ int cache_do_control(stream_t *stream, int cmd, void *arg) { case STREAM_CTRL_GET_NUM_ANGLES: case STREAM_CTRL_GET_ANGLE: case STREAM_CTRL_GET_SIZE: + case STREAM_CTRL_MANAGES_TIMELINE: case -2: s->control = cmd; break; @@ -707,6 +711,8 @@ int cache_do_control(stream_t *stream, int cmd, void *arg) { case STREAM_CTRL_GET_LANG: *(struct stream_lang_req *)arg = s->control_lang_arg; break; + case STREAM_CTRL_MANAGES_TIMELINE: + break; } return s->control_res; } diff --git a/stream/stream.c b/stream/stream.c index 8e38d1983e..36594d8556 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -769,3 +769,8 @@ struct bstr stream_read_complete(struct stream *s, void *talloc_ctx, buf, total_read }; } + +bool stream_manages_timeline(struct stream *s) +{ + return stream_control(s, STREAM_CTRL_MANAGES_TIMELINE, NULL) == STREAM_OK; +} diff --git a/stream/stream.h b/stream/stream.h index c47452aeb9..b6fe40b56a 100644 --- a/stream/stream.h +++ b/stream/stream.h @@ -101,6 +101,8 @@ #define STREAM_CTRL_GET_CACHE_FILL 16 #define STREAM_CTRL_GET_CACHE_IDLE 17 #define STREAM_CTRL_RECONNECT 18 +// DVD/Bluray, signal general support for GET_CURRENT_TIME etc. +#define STREAM_CTRL_MANAGES_TIMELINE 19 struct stream_lang_req { int type; // STREAM_AUDIO, STREAM_SUB @@ -406,6 +408,8 @@ int stream_read_internal(stream_t *s, void *buf, int len); /// Internal seek function bypassing the stream buffer int stream_seek_internal(stream_t *s, int64_t newpos); +bool stream_manages_timeline(stream_t *s); + extern int dvd_title; extern int dvd_angle; diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c index 0207ae3969..0b85e320ba 100644 --- a/stream/stream_dvd.c +++ b/stream/stream_dvd.c @@ -712,6 +712,8 @@ static int control(stream_t *stream,int cmd,void* arg) snprintf(req->name, sizeof(req->name), "%c%c", lang >> 8, lang); return STREAM_OK; } + case STREAM_CTRL_MANAGES_TIMELINE: + return STREAM_OK; } return STREAM_UNSUPPORTED; } |