* modules/stream_out/bridge.c: Fixed deleting/adding of streams.
authorChristophe Massiot <massiot@videolan.org>
Fri, 20 May 2005 18:16:33 +0000 (18:16 +0000)
committerChristophe Massiot <massiot@videolan.org>
Fri, 20 May 2005 18:16:33 +0000 (18:16 +0000)
 * modules/stream_out/mosaic_bridge.c: Fixed potential segfault.
 * modules/video_filter/mosaic.c: Run the mosaic thread in a higher priority.

modules/stream_out/bridge.c
modules/stream_out/mosaic_bridge.c
modules/video_filter/mosaic.c

index 1b24f66..0f949c3 100644 (file)
@@ -432,6 +432,8 @@ static int SendIn( sout_stream_t *p_stream, sout_stream_id_t *id,
                           < p_bridge->pp_es[i]->i_last) )
         {
             block_t *p_block = p_bridge->pp_es[i]->p_block;
+            msg_Dbg( p_stream, "dropping a packet (" I64Fd ")",
+                     p_bridge->pp_es[i]->i_last - p_block->i_dts );
             p_bridge->pp_es[i]->p_block
                 = p_bridge->pp_es[i]->p_block->p_next;
             block_Release( p_block );
@@ -489,10 +491,9 @@ static int SendIn( sout_stream_t *p_stream, sout_stream_id_t *id,
         if ( p_bridge->pp_es[i]->id != NULL )
         {
             block_t *p_block = p_bridge->pp_es[i]->p_block;
-            p_bridge->pp_es[i]->i_last = p_bridge->pp_es[i]->p_block->i_dts
-                                   + p_bridge->pp_es[i]->p_block->i_length;
             while ( p_block != NULL )
             {
+                p_bridge->pp_es[i]->i_last = p_block->i_dts;
                 p_block->i_pts += p_sys->i_delay;
                 p_block->i_dts += p_sys->i_delay;
                 p_block = p_block->p_next;
index 41c2a98..9c4b4f3 100644 (file)
@@ -408,7 +408,6 @@ static int Send( sout_stream_t *p_stream, sout_stream_id_t *id,
 
             vout_CopyPicture( p_stream, p_new_pic, p_pic );
         }
-        p_pic->pf_release( p_pic );
 
         p_new_pic->i_refcount = 1;
         p_new_pic->i_status = DESTROYED_PICTURE;
@@ -417,6 +416,7 @@ static int Send( sout_stream_t *p_stream, sout_stream_id_t *id,
         p_new_pic->pf_release = ReleasePicture;
         p_new_pic->date = p_pic->date;
 
+        p_pic->pf_release( p_pic );
         PushPicture( p_stream, p_new_pic );
     }
 
index 83a0965..a008d83 100644 (file)
@@ -164,6 +164,9 @@ static int CreateFilter( vlc_object_t *p_this )
     int i_index;
     vlc_value_t val;
 
+    /* The mosaic thread is more important than the decoder threads */
+    vlc_thread_set_priority( p_this, VLC_THREAD_PRIORITY_OUTPUT );
+
     /* Allocate structure */
     p_sys = p_filter->p_sys = malloc( sizeof( filter_sys_t ) );
     if( p_sys == NULL )