summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2011-01-25 14:41:12 +0000
committerphintuka <phintuka>2011-01-25 14:41:12 +0000
commite7230c194f429723db0774d2df3e22265d418a74 (patch)
tree6cd37484099b220d43a1b51963326d5fe1529cf9
parentcbfac35a3c98861001d00defa0cf4f94f86e78c2 (diff)
downloadxineliboutput-e7230c194f429723db0774d2df3e22265d418a74.tar.gz
xineliboutput-e7230c194f429723db0774d2df3e22265d418a74.tar.bz2
Improved title name display in navigation mode
(use disc library metadata if present)
-rw-r--r--xine/BluRay/input_bluray.c41
1 files changed, 34 insertions, 7 deletions
diff --git a/xine/BluRay/input_bluray.c b/xine/BluRay/input_bluray.c
index 8de02e51..0a86d4cb 100644
--- a/xine/BluRay/input_bluray.c
+++ b/xine/BluRay/input_bluray.c
@@ -240,12 +240,39 @@ static void update_title_info(bluray_input_plugin_t *this)
.data = &udata,
.data_length = sizeof(udata)
};
- if (this->disc_name && this->disc_name[0])
- udata.str_len = snprintf(udata.str, sizeof(udata.str), "%s, Title %d/%d",
- this->disc_name, this->current_title_idx + 1, this->num_title_idx);
- else
- udata.str_len = snprintf(udata.str, sizeof(udata.str), "Title %d/%d",
- this->current_title_idx + 1, this->num_title_idx);
+
+ char title_name[64] = "";
+
+ if (this->meta_dl) {
+ unsigned i;
+ for (i = 0; i < this->meta_dl->toc_count; i++)
+ if (this->meta_dl->toc_entries[i].title_number == (unsigned)this->current_title)
+ if (this->meta_dl->toc_entries[i].title_name)
+ if (strlen(this->meta_dl->toc_entries[i].title_name) > 2)
+ strncpy(title_name, this->meta_dl->toc_entries[i].title_name, sizeof(title_name));
+ }
+
+ if (title_name[0]) {
+ } else if (this->current_title == BLURAY_TITLE_TOP_MENU) {
+ strcpy(title_name, "Top Menu");
+ } else if (this->current_title == BLURAY_TITLE_FIRST_PLAY) {
+ strcpy(title_name, "First Play");
+ } else if (this->nav_mode) {
+ snprintf(title_name, sizeof(title_name), "Title %d/%d (PL %d/%d)",
+ this->current_title, this->num_titles,
+ this->current_title_idx + 1, this->num_title_idx);
+ } else {
+ snprintf(title_name, sizeof(title_name), "Title %d/%d",
+ this->current_title_idx + 1, this->num_title_idx);
+ }
+
+ if (this->disc_name && this->disc_name[0]) {
+ udata.str_len = snprintf(udata.str, sizeof(udata.str), "%s, %s",
+ this->disc_name, title_name);
+ } else {
+ udata.str_len = snprintf(udata.str, sizeof(udata.str), "%s",
+ title_name);
+ }
xine_event_send(this->stream, &uevent);
_x_meta_info_set(this->stream, XINE_META_INFO_TITLE, udata.str);
@@ -1102,7 +1129,7 @@ static int bluray_plugin_open (input_plugin_t *this_gen)
this->meta_dl = bd_get_meta(this->bdh);
- if (this->meta_dl && this->meta_dl->di_name) {
+ if (this->meta_dl && this->meta_dl->di_name && strlen(this->meta_dl->di_name) > 1) {
this->disc_name = strdup(this->meta_dl->di_name);
}
else if (strcmp(this->disc_root, this->class->mountpoint)) {