From b01e8d6210adcf0b68313d1b31f904c121020401 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 4 May 2013 01:20:39 +0200 Subject: stream: report chapter times, use time seeks for DVD chapters Allow the stream layer to report chapter times. Extend stream_dvd to do this. I'm not 100% sure whether the re-used code is bug-free (because it was used for slave-mode and/or debugging only). MAke the frontend do time-based seeks when switching DVD chapters. I'm not sure if there's a real reason STREAM_CTRL_SEEK_TO_CHAPTER exists (maybe/hopefully not), but we will see. Note that querying chapter times in demuxer_chapter_time() with the new STREAM_CTRL_GET_CHAPTER_TIME could be excessively slow, especially with the cache enabled. The frontend likes to query chapter times very often. Additionally, stream_dvd uses some sort of quadratic algorithm to list times for all chapters. For this reason, we try to query all chapters on start (after the demuxer is opened), and add the chapters to the demuxer chapter list. demuxer_chapter_time() will get the time from that list, instead of asking the stream layer over and over again. This assumes stream_dvd knows the list of chapters at the start, and also that the list of chapters never changes during playback. This seems to be true, and the only exception, switching DVD titles, is not supported at runtime (and doesn't need to be supported). --- stream/stream.h | 1 + 1 file changed, 1 insertion(+) (limited to 'stream/stream.h') diff --git a/stream/stream.h b/stream/stream.h index 2d4fd3862d..df4188ed94 100644 --- a/stream/stream.h +++ b/stream/stream.h @@ -104,6 +104,7 @@ // DVD/Bluray, signal general support for GET_CURRENT_TIME etc. #define STREAM_CTRL_MANAGES_TIMELINE 19 #define STREAM_CTRL_GET_START_TIME 20 +#define STREAM_CTRL_GET_CHAPTER_TIME 21 struct stream_lang_req { int type; // STREAM_AUDIO, STREAM_SUB -- cgit v1.2.3