[vlc-commits] livehttp: remove leftover segments if delsegs is on

Ilkka Ollakka git at videolan.org
Mon Oct 28 17:25:24 CET 2013


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Mon Oct 28 18:13:42 2013 +0200| [d9c624c0ab3af4afd41b5c58f071f4f4153fd0e7] | committer: Ilkka Ollakka

livehttp: remove leftover segments if delsegs is on

Also check if i_numsegs is setted as delsegs is tru by default
and we don't want to cause suprises to people creating VOD-stuff.

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

 modules/access_output/livehttp.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/access_output/livehttp.c b/modules/access_output/livehttp.c
index 65b104a..60bb0c7 100644
--- a/modules/access_output/livehttp.c
+++ b/modules/access_output/livehttp.c
@@ -781,6 +781,12 @@ static void Close( vlc_object_t * p_this )
     {
         output_segment_t *segment = vlc_array_item_at_index( p_sys->segments_t, 0 );
         vlc_array_remove( p_sys->segments_t, 0 );
+        if( p_sys->b_delsegs && p_sys->i_numsegs && segment->psz_filename )
+        {
+            msg_Dbg( p_access, "Removing segment number %d name %s", segment->i_segment_number, segment->psz_filename );
+            vlc_unlink( segment->psz_filename );
+        }
+
         destroySegment( segment );
     }
     vlc_array_destroy( p_sys->segments_t );



More information about the vlc-commits mailing list