1
0
Fork 0

Fix checking for empty disc index

- fixes playback of discs with only first play or top menu title.
This commit is contained in:
hpi1 2018-09-02 11:29:33 +03:00
parent e312806db4
commit c7b971e0cf
1 changed files with 8 additions and 2 deletions

View File

@ -105,8 +105,14 @@ static int _parse_index(BITSTREAM *bs, INDX_ROOT *index)
index->num_titles = bs_read(bs, 16);
if (!index->num_titles) {
BD_DEBUG(DBG_CRIT, "empty index\n");
return 0;
/* no "normal" titles - check for first play and top menu */
if ((index->first_play.object_type == indx_object_type_hdmv && index->first_play.hdmv.id_ref == 0xffff) &&
(index->top_menu.object_type == indx_object_type_hdmv && index->top_menu.hdmv.id_ref == 0xffff)) {
BD_DEBUG(DBG_CRIT, "empty index\n");
return 0;
}
return 1;
}
index->titles = calloc(index->num_titles, sizeof(INDX_TITLE));