[libbluray-devel] mpls: accept version 0300 files
hpi1
git at videolan.org
Wed Aug 30 09:13:55 CEST 2017
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Wed Aug 30 10:10:58 2017 +0300| [7e31c24f4cb21502edb12ee3894784fe94e88dd3] | committer: hpi1
mpls: accept version 0300 files
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=7e31c24f4cb21502edb12ee3894784fe94e88dd3
---
src/libbluray/bdnav/mpls_parse.c | 39 +++++++--------------------------------
1 file changed, 7 insertions(+), 32 deletions(-)
diff --git a/src/libbluray/bdnav/mpls_parse.c b/src/libbluray/bdnav/mpls_parse.c
index 579006fd..358b6342 100644
--- a/src/libbluray/bdnav/mpls_parse.c
+++ b/src/libbluray/bdnav/mpls_parse.c
@@ -25,6 +25,7 @@
#include "mpls_parse.h"
#include "extdata_parse.h"
+#include "bdmv_parse.h"
#include "uo_mask.h"
#include "disc/disc.h"
@@ -37,23 +38,7 @@
#include <stdlib.h>
#include <string.h>
-#define MPLS_SIG1 ('M' << 24 | 'P' << 16 | 'L' << 8 | 'S')
-#define MPLS_SIG2A ('0' << 24 | '2' << 16 | '0' << 8 | '0')
-#define MPLS_SIG2B ('0' << 24 | '1' << 16 | '0' << 8 | '0')
-
-static void
-_human_readable_sig(char *sig, uint32_t s1, uint32_t s2)
-{
- sig[0] = (s1 >> 24) & 0xFF;
- sig[1] = (s1 >> 16) & 0xFF;
- sig[2] = (s1 >> 8) & 0xFF;
- sig[3] = (s1 ) & 0xFF;
- sig[4] = (s2 >> 24) & 0xFF;
- sig[5] = (s2 >> 16) & 0xFF;
- sig[6] = (s2 >> 8) & 0xFF;
- sig[7] = (s2 ) & 0xFF;
- sig[8] = 0;
-}
+#define MPLS_SIG1 ('M' << 24 | 'P' << 16 | 'L' << 8 | 'S')
static int
_parse_uo(BITSTREAM *bits, BD_UO_MASK *uo)
@@ -103,26 +88,16 @@ _parse_appinfo(BITSTREAM *bits, MPLS_AI *ai)
static int
_parse_header(BITSTREAM *bits, MPLS_PL *pl)
{
- if (bs_avail(bits) < 5 * 32 + 160) {
- BD_DEBUG(DBG_NAV | DBG_CRIT, "_parse_header: unexpected end of file\n");
+ pl->type_indicator = MPLS_SIG1;
+ if (!bdmv_parse_header(bits, pl->type_indicator, &pl->type_indicator2)) {
return 0;
}
- pl->type_indicator = bs_read(bits, 32);
- pl->type_indicator2 = bs_read(bits, 32);
- if (pl->type_indicator != MPLS_SIG1 ||
- (pl->type_indicator2 != MPLS_SIG2A &&
- pl->type_indicator2 != MPLS_SIG2B)) {
-
- char sig[9];
- char expect[9];
-
- _human_readable_sig(sig, pl->type_indicator, pl->type_indicator2);
- _human_readable_sig(expect, MPLS_SIG1, MPLS_SIG2A);
- BD_DEBUG(DBG_NAV | DBG_CRIT, "failed signature match, expected (%s) got (%s)\n",
- expect, sig);
+ if (bs_avail(bits) < 5 * 32 + 160) {
+ BD_DEBUG(DBG_NAV | DBG_CRIT, "_parse_header: unexpected end of file\n");
return 0;
}
+
pl->list_pos = bs_read(bits, 32);
pl->mark_pos = bs_read(bits, 32);
pl->ext_pos = bs_read(bits, 32);
More information about the libbluray-devel
mailing list