[vlc-devel] commit: sout_StreamChainDelete: iterative implementation ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed Feb 10 21:54:23 CET 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Feb 10 22:54:02 2010 +0200| [dccd7a6b8ac995823caf3f1e9b17302b2fbced16] | committer: Rémi Denis-Courmont 

sout_StreamChainDelete: iterative implementation

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

 src/stream_output/stream_output.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/stream_output/stream_output.c b/src/stream_output/stream_output.c
index 19b1499..103d690 100644
--- a/src/stream_output/stream_output.c
+++ b/src/stream_output/stream_output.c
@@ -812,14 +812,15 @@ static void sout_StreamDelete( sout_stream_t *p_stream )
  */
 void sout_StreamChainDelete(sout_stream_t *p_first, sout_stream_t *p_last)
 {
-    if(!p_first)
-        return;
-
-    sout_stream_t *p_next = p_first->p_next;
+    while(p_first != NULL)
+    {
+        sout_stream_t *p_next = p_first->p_next;
 
-    sout_StreamDelete(p_first);
-    if(p_first != p_last)
-        sout_StreamChainDelete(p_next, p_last);
+        sout_StreamDelete(p_first);
+        if(p_first == p_last)
+           break;
+        p_first = p_next;
+    }
 }
 
 /* Create a "stream_out" module, which may forward its ES to p_next module */




More information about the vlc-devel mailing list