[libbluray-devel] commit: Eliminated local variable (hpi1 )

git at videolan.org git at videolan.org
Fri Aug 13 23:58:40 CEST 2010


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Fri Aug 13 23:27:12 2010 +0300| [8696b21cb72a954d23cb5682e912de3ffd517a5d] | committer: hpi1 

Eliminated local variable

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

 src/libbluray/hdmv/mobj_parse.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/libbluray/hdmv/mobj_parse.c b/src/libbluray/hdmv/mobj_parse.c
index 2eeb4ab..b211ef2 100644
--- a/src/libbluray/hdmv/mobj_parse.c
+++ b/src/libbluray/hdmv/mobj_parse.c
@@ -52,8 +52,7 @@ static int _mobj_parse_header(BITSTREAM *bs, int *extension_data_start)
 
 static int _mobj_parse_object(BITSTREAM *bs, MOBJ_OBJECT *obj)
 {
-    uint16_t num_cmds;
-    int      i;
+    int i;
 
     obj->resume_intention_flag = bs_read(bs, 1);
     obj->menu_call_mask = bs_read(bs, 1);
@@ -61,10 +60,8 @@ static int _mobj_parse_object(BITSTREAM *bs, MOBJ_OBJECT *obj)
 
     bs_skip(bs, 13); /* padding */
 
-    num_cmds = bs_read(bs, 16);
-
-    obj->cmds = calloc(num_cmds, sizeof(MOBJ_CMD));
-    obj->num_cmds = num_cmds;
+    obj->num_cmds = bs_read(bs, 16);
+    obj->cmds     = calloc(obj->num_cmds, sizeof(MOBJ_CMD));
 
     for (i = 0; i < obj->num_cmds; i++) {
 



More information about the libbluray-devel mailing list