[libbluray-devel] clpi_dump: use public API

hpi1 git at videolan.org
Fri Aug 23 09:26:18 CEST 2013


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sat Aug  3 01:05:25 2013 +0300| [df3e835d3162a9484406549c3a19fe2bf220e1c2] | committer: hpi1

clpi_dump: use public API

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=df3e835d3162a9484406549c3a19fe2bf220e1c2
---

 src/examples/Makefile.am |    8 ++------
 src/examples/clpi_dump.c |    9 +++++----
 src/libbluray/bluray.c   |    5 +++++
 src/libbluray/bluray.h   |    1 +
 4 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/src/examples/Makefile.am b/src/examples/Makefile.am
index 60b451e..bdec9f3 100644
--- a/src/examples/Makefile.am
+++ b/src/examples/Makefile.am
@@ -33,12 +33,8 @@ mpls_dump_SOURCES = \
 	../libbluray/bdnav/navigation.c
 
 clpi_dump_SOURCES = \
-	clpi_dump.c util.c util.h \
-	../util/bits.c \
-	../util/logging.c \
-	../file/file_posix.c \
-	../libbluray/bdnav/extdata_parse.c \
-	../libbluray/bdnav/clpi_parse.c
+	clpi_dump.c util.c util.h
+clpi_dump_LDADD = $(BLURAY_LIB)
 
 sound_dump_SOURCES = \
 	sound_dump.c \
diff --git a/src/examples/clpi_dump.c b/src/examples/clpi_dump.c
index e0d45d1..e9d994f 100644
--- a/src/examples/clpi_dump.c
+++ b/src/examples/clpi_dump.c
@@ -25,7 +25,8 @@
 #include <unistd.h>
 #include <inttypes.h>
 
-#include "libbluray/bdnav/clpi_parse.h"
+#include "libbluray/bdnav/clpi_data.h"
+#include "libbluray/bluray.h"
 
 #include "util.h"
 
@@ -438,9 +439,9 @@ main(int argc, char *argv[])
     }
 
     for (ii = optind; ii < argc; ii++) {
-        cl = clpi_parse(argv[ii]);
+        cl = bd_read_clpi(argv[ii]);
         if (cl == NULL) {
-            fprintf(stderr, "Parse failed\n");
+            fprintf(stderr, "Parsing %s failed\n", argv[ii]);
             continue;
         }
         if (opt_clip_info) {
@@ -481,7 +482,7 @@ main(int argc, char *argv[])
             }
         }
 
-        clpi_free(cl);
+        bd_free_clpi(cl);
     }
     return 0;
 }
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index 2f8cefc..3625688 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -3111,6 +3111,11 @@ struct clpi_cl *bd_get_clpi(BLURAY *bd, unsigned clip_ref)
     return NULL;
 }
 
+struct clpi_cl *bd_read_clpi(const char *path)
+{
+    return clpi_parse(path);
+}
+
 void bd_free_clpi(struct clpi_cl *cl)
 {
     clpi_free(cl);
diff --git a/src/libbluray/bluray.h b/src/libbluray/bluray.h
index 05b6c0a..b494731 100644
--- a/src/libbluray/bluray.h
+++ b/src/libbluray/bluray.h
@@ -813,6 +813,7 @@ struct clpi_cl;
  * @return pointer to allocated CLPI_CL object on success, NULL on error
  */
 struct clpi_cl *bd_get_clpi(BLURAY *bd, unsigned clip_ref);
+struct clpi_cl *bd_read_clpi(const char *clpi_file);
 
 /**
  *



More information about the libbluray-devel mailing list