[libbluray-devel] commit: Added _free_ig_object() (hpi1 )
git at videolan.org
git at videolan.org
Thu Oct 14 17:23:23 CEST 2010
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu Oct 14 18:21:22 2010 +0300| [5de3b4395037c6aa3f4d924c1a8e8e002d6aa97f] | committer: hpi1
Added _free_ig_object()
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=5de3b4395037c6aa3f4d924c1a8e8e002d6aa97f
---
src/libbluray/hdmv/hdmv_vm.c | 20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/src/libbluray/hdmv/hdmv_vm.c b/src/libbluray/hdmv/hdmv_vm.c
index 31374b9..3c791b9 100644
--- a/src/libbluray/hdmv/hdmv_vm.c
+++ b/src/libbluray/hdmv/hdmv_vm.c
@@ -246,16 +246,21 @@ HDMV_VM *hdmv_vm_init(const char *disc_root, BD_REGISTERS *regs)
return p;
}
+static void _free_ig_object(HDMV_VM *p)
+{
+ if (p->ig_object) {
+ X_FREE(p->ig_object->cmds);
+ X_FREE(p->ig_object);
+ }
+}
+
void hdmv_vm_free(HDMV_VM **p)
{
if (p && *p) {
- mobj_free(&(*p)->movie_objects);
+ mobj_free(&(*p)->movie_objects);
- if ((*p)->ig_object) {
- X_FREE((*p)->ig_object->cmds);
- X_FREE((*p)->ig_object);
- }
+ _free_ig_object(*p);
X_FREE(*p);
}
@@ -889,10 +894,7 @@ int hdmv_vm_set_object(HDMV_VM *p, int num_nav_cmds, void *nav_cmds)
{
p->object = NULL;
- if (p->ig_object) {
- X_FREE(p->ig_object->cmds);
- X_FREE(p->ig_object);
- }
+ _free_ig_object(p);
if (nav_cmds && num_nav_cmds > 0) {
MOBJ_OBJECT *ig_object = calloc(1, sizeof(MOBJ_OBJECT));
More information about the libbluray-devel
mailing list