[libbluray-devel] Add libudfread git submodule
hpi1
git at videolan.org
Thu Feb 12 10:54:47 CET 2015
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu Feb 12 11:53:04 2015 +0200| [2cfddf9a3c199257d04e787d179ae47cf1a10e98] | committer: hpi1
Add libudfread git submodule
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=2cfddf9a3c199257d04e787d179ae47cf1a10e98
---
.gitmodules | 3 +++
contrib/libudfread | 1 +
src/libbluray/disc/udf_fs.c | 20 +++++++++++++++-----
3 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..e2722d7
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "contrib/libudfread"]
+ path = contrib/libudfread
+ url = git://git.videolan.org/libudfread.git
diff --git a/contrib/libudfread b/contrib/libudfread
new file mode 160000
index 0000000..06c3cb9
--- /dev/null
+++ b/contrib/libudfread
@@ -0,0 +1 @@
+Subproject commit 06c3cb9223a3cb5ab048e42ab353958f422a8f57
diff --git a/src/libbluray/disc/udf_fs.c b/src/libbluray/disc/udf_fs.c
index 6d5f25b..3068710 100644
--- a/src/libbluray/disc/udf_fs.c
+++ b/src/libbluray/disc/udf_fs.c
@@ -198,21 +198,31 @@ static struct udfread_block_input *_block_input(const char *img)
void *udf_image_open(const char *img_path)
{
- udfread *udf = NULL;
+ udfread *udf = udfread_init();
+ int result = -1;
+
+ if (!udf) {
+ return NULL;
+ }
/* app handles file I/O ? */
if (file_open != file_open_default()) {
struct udfread_block_input *bi = _block_input(img_path);
if (bi) {
- udf = udfread_open_input(bi);
- if (!udf) {
+ result = udfread_open_input(udf, bi);
+ if (result < 0) {
bi->close(bi);
}
}
}
- if (!udf) {
- udf = (void*)udfread_open(img_path);
+ if (result < 0) {
+ result = udfread_open(udf, img_path);
+ }
+
+ if (result < 0) {
+ udfread_close(udf);
+ return NULL;
}
return (void*)udf;
More information about the libbluray-devel
mailing list