diff options
author | phintuka <phintuka> | 2010-06-15 16:47:18 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2010-06-15 16:47:18 +0000 |
commit | 8da32a9ff93bade191c844ce46914a18d90797a8 (patch) | |
tree | 4d8dadba78c73f5476601f6cb8453b1b455cd7d3 /xine/BluRay/input_bluray.c | |
parent | 3a8608d6a14161407c33769e1de1c51c23e86bcb (diff) | |
download | xineliboutput-8da32a9ff93bade191c844ce46914a18d90797a8.tar.gz xineliboutput-8da32a9ff93bade191c844ce46914a18d90797a8.tar.bz2 |
Reset demuxer when seeking internally to chapter/title
Diffstat (limited to 'xine/BluRay/input_bluray.c')
-rw-r--r-- | xine/BluRay/input_bluray.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/xine/BluRay/input_bluray.c b/xine/BluRay/input_bluray.c index 5e244c63..e45cf4f1 100644 --- a/xine/BluRay/input_bluray.c +++ b/xine/BluRay/input_bluray.c @@ -52,6 +52,7 @@ #define LOGMSG(x...) xine_log (this->stream->xine, XINE_LOG_MSG, "input_bluray: " x); +#define XINE_ENGINE_INTERNAL #ifdef HAVE_CONFIG_H # include "xine_internal.h" @@ -110,6 +111,8 @@ typedef struct { int current_title; BD_TITLE_INFO *title_info; + uint32_t cap_seekable; + } bluray_input_plugin_t; static int get_current_chapter(bluray_input_plugin_t *this) @@ -202,6 +205,17 @@ static int open_title (bluray_input_plugin_t *this, int title) return 1; } +static void stream_reset(bluray_input_plugin_t *this) +{ + this->cap_seekable = 0; + + xine_set_param(this->stream, XINE_PARAM_FINE_SPEED, XINE_FINE_SPEED_NORMAL); + this->stream->demux_plugin->seek(this->stream->demux_plugin, 0, 0, 1); + _x_demux_control_start(this->stream); + + this->cap_seekable = INPUT_CAP_SEEKABLE; +} + static void handle_events(bluray_input_plugin_t *this) { if (!this->event_queue) @@ -220,11 +234,13 @@ static void handle_events(bluray_input_plugin_t *this) case XINE_EVENT_INPUT_LEFT: lprintf("XINE_EVENT_INPUT_LEFT: next title\n"); open_title(this, MAX(0, this->current_title-1)); + stream_reset(this); break; case XINE_EVENT_INPUT_RIGHT: lprintf("XINE_EVENT_INPUT_RIGHT: previous title\n"); open_title(this, MIN(this->num_titles, this->current_title+1)); + stream_reset(this); break; case XINE_EVENT_INPUT_NEXT: { @@ -233,11 +249,14 @@ static void handle_events(bluray_input_plugin_t *this) lprintf("XINE_EVENT_INPUT_NEXT: next chapter\n"); if (chapter >= this->title_info->chapter_count) { - if (this->current_title < this->num_titles - 1) + if (this->current_title < this->num_titles - 1) { open_title(this, this->current_title + 1); + stream_reset(this); + } } else { bd_seek_chapter(this->bdh, chapter); - _x_stream_info_set(this->stream, XINE_STREAM_INFO_DVD_CHAPTER_NUMBER, chapter+1); + update_stream_info(this); + stream_reset(this); } break; } @@ -249,10 +268,12 @@ static void handle_events(bluray_input_plugin_t *this) if (chapter < 0 && this->current_title > 0) { open_title(this, this->current_title - 1); + stream_reset(this); } else { chapter = MAX(0, chapter); bd_seek_chapter(this->bdh, chapter); - _x_stream_info_set(this->stream, XINE_STREAM_INFO_DVD_CHAPTER_NUMBER, chapter+1); + update_stream_info(this); + stream_reset(this); } break; } @@ -284,7 +305,8 @@ static void handle_events(bluray_input_plugin_t *this) static uint32_t bluray_plugin_get_capabilities (input_plugin_t *this_gen) { - return INPUT_CAP_SEEKABLE | + bluray_input_plugin_t *this = (bluray_input_plugin_t *) this_gen; + return this->cap_seekable | INPUT_CAP_BLOCK | INPUT_CAP_AUDIOLANG | INPUT_CAP_SPULANG | @@ -657,6 +679,8 @@ static input_plugin_t *bluray_class_get_instance (input_class_t *cls_gen, xine_s this->class = (bluray_input_class_t*)cls_gen; this->mrl = strdup(mrl); + this->cap_seekable = INPUT_CAP_SEEKABLE; + this->input_plugin.open = bluray_plugin_open; this->input_plugin.get_capabilities = bluray_plugin_get_capabilities; this->input_plugin.read = bluray_plugin_read; |