[vlc-commits] demux: libasf: split object parenting

Francois Cartegnie git at videolan.org
Mon Feb 13 17:23:10 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Feb 13 16:00:06 2017 +0100| [f4ac12b19476cee42f8725a16862e5c23eb6ccdf] | committer: Francois Cartegnie

demux: libasf: split object parenting

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

 modules/demux/asf/libasf.c | 30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/modules/demux/asf/libasf.c b/modules/demux/asf/libasf.c
index a08ea94..b3ac00e 100644
--- a/modules/demux/asf/libasf.c
+++ b/modules/demux/asf/libasf.c
@@ -1460,6 +1460,22 @@ static const struct
     { &asf_object_null_guid, 0, NULL, NULL }
 };
 
+static void ASF_ParentObject( asf_object_t *p_father, asf_object_t *p_obj )
+{
+    if( p_father )
+    {
+        if( p_father->common.p_first )
+        {
+            p_father->common.p_last->common.p_next = p_obj;
+        }
+        else
+        {
+            p_father->common.p_first = p_obj;
+        }
+        p_father->common.p_last = p_obj;
+    }
+}
+
 static int ASF_ReadObject( stream_t *s, asf_object_t *p_obj,
                            asf_object_t *p_father )
 {
@@ -1517,18 +1533,8 @@ static int ASF_ReadObject( stream_t *s, asf_object_t *p_obj,
     }
 
     /* link this object with father */
-    if( p_father && ! i_result )
-    {
-        if( p_father->common.p_first )
-        {
-            p_father->common.p_last->common.p_next = p_obj;
-        }
-        else
-        {
-            p_father->common.p_first = p_obj;
-        }
-        p_father->common.p_last = p_obj;
-    }
+    if ( i_result == VLC_SUCCESS )
+        ASF_ParentObject( p_father, p_obj );
 
     return i_result;
 }



More information about the vlc-commits mailing list