[libbluray-devel] clpi: accept version 0300 files
hpi1
git at videolan.org
Wed Aug 30 09:07:41 CEST 2017
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Tue Aug 29 09:55:14 2017 +0300| [344ae59cebbb9a1342859c278e25d1bfd80adc90] | committer: hpi1
clpi: accept version 0300 files
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=344ae59cebbb9a1342859c278e25d1bfd80adc90
---
src/libbluray/bdnav/clpi_parse.c | 35 +++--------------------------------
1 file changed, 3 insertions(+), 32 deletions(-)
diff --git a/src/libbluray/bdnav/clpi_parse.c b/src/libbluray/bdnav/clpi_parse.c
index ef72543e..6cf4f862 100644
--- a/src/libbluray/bdnav/clpi_parse.c
+++ b/src/libbluray/bdnav/clpi_parse.c
@@ -25,6 +25,7 @@
#include "clpi_parse.h"
#include "extdata_parse.h"
+#include "bdmv_parse.h"
#include "disc/disc.h"
@@ -37,22 +38,6 @@
#include <string.h>
#define CLPI_SIG1 ('H' << 24 | 'D' << 16 | 'M' << 8 | 'V')
-#define CLPI_SIG2A ('0' << 24 | '2' << 16 | '0' << 8 | '0')
-#define CLPI_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;
-}
static int
_parse_stream_attr(BITSTREAM *bits, CLPI_PROG_STREAM *ss)
@@ -127,25 +112,11 @@ _parse_stream_attr(BITSTREAM *bits, CLPI_PROG_STREAM *ss)
static int
_parse_header(BITSTREAM *bits, CLPI_CL *cl)
{
- if (bs_seek_byte(bits, 0) < 0) {
+ cl->type_indicator = CLPI_SIG1;
+ if (!bdmv_parse_header(bits, cl->type_indicator, &cl->type_indicator2)) {
return 0;
}
- cl->type_indicator = bs_read(bits, 32);
- cl->type_indicator2 = bs_read(bits, 32);
- if (cl->type_indicator != CLPI_SIG1 ||
- (cl->type_indicator2 != CLPI_SIG2A &&
- cl->type_indicator2 != CLPI_SIG2B)) {
-
- char sig[9];
- char expect[9];
-
- _human_readable_sig(sig, cl->type_indicator, cl->type_indicator2);
- _human_readable_sig(expect, CLPI_SIG1, CLPI_SIG2A);
- BD_DEBUG(DBG_NAV | DBG_CRIT, "failed signature match expected (%s) got (%s)\n",
- expect, sig);
- return 0;
- }
cl->sequence_info_start_addr = bs_read(bits, 32);
cl->program_info_start_addr = bs_read(bits, 32);
cl->cpi_start_addr = bs_read(bits, 32);
More information about the libbluray-devel
mailing list