[libbluray-devel] Fix for wrong title index used in some BDs

Petri Hintukainen phintuka at users.sourceforge.net
Thu Mar 17 16:13:35 CET 2011


tourettes wrote:
> Hi,
> 
> Some BDs have .mpls file indices that aren't continuos. For example one 
> BD has 00001, 00002, 00003, 00004, 00006 & 00007 .mpls (00005 is missing).
> 
> Current implementation is using the atoi to convert the filename 
> directly into the title index

No, not to title index but playlist ID. Using that as title index would
be a bug. Note that title_idx (title index) is index to internal array
of titles, playlist ID is the number in playlist file name.

> where as the proposed patch is using 
> bd->title_idx. I have tested this patch with approx 20 BDs and it seems 
> to work fine. Now BD_EVENT_PLAYLIST's parameter is providing the correct 
> title index and it can be used to query the currently active title 
> information.

BD_EVENT_PLAYLIST reports current playlist ID, not title index. Also
PSR_PLAYLIST must contain playlist ID, on-disc applications (HDMV/BD-J
titles / popup menus) except it.

With BD_EVENT_PLAYLIST you can use bd_get_playlist_info() instead of
bd_get_title_info(). Those provide the same information. Maybe API
documentation of those functions could be clarified ?

I don't belive BD_EVENT_TITLE_IDX would be very useful, it would be
generated only when application selects title with bd_select_title(bd,
title_idx) - already knowing the title_idx.

> I'm not sure if that is the correct way to fix the issue, maybe there 
> are some other parts in the library that are generating the filename 
> based on that index information and in that case we should have "ghost" 
> entries in the title list to fill in those missing .mpls files.
> 
> 
>  From d2f5137724263531594306adf7587fd75e197c47 Mon Sep 17 00:00:00 2001
> From: tourettes <tourettesmp at gmail.com>
> Date: Tue, 15 Mar 2011 16:13:47 +0200
> Subject: [PATCH] Fixed _open_playlist - wrong tile index was used
>   On BDs that have "jumps" in the .mpls filename numbering a wrong title 
> index could be used.
> -
>   src/libbluray/bluray.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
> index 138ab01..0af8eaa 100644
> --- a/src/libbluray/bluray.c
> +++ b/src/libbluray/bluray.c
> @@ -1243,7 +1243,7 @@ static int _open_playlist(BLURAY *bd, const char 
> *f_name)
> 
>       bd->next_chapter_start = bd_chapter_pos(bd, 1);
> 
> -    bd_psr_write(bd->regs, PSR_PLAYLIST, atoi(bd->title->name));
> +    bd_psr_write(bd->regs, PSR_PLAYLIST, bd->title_idx);
>       bd_psr_write(bd->regs, PSR_ANGLE_NUMBER, bd->title->angle + 1);
>       bd_psr_write(bd->regs, PSR_CHAPTER, 1);




More information about the libbluray-devel mailing list