[vlc-devel] commit: video_output: Don' t keep the input around for a long time in RunThread. (Pierre d'Herbemont )

git version control git at videolan.org
Sun Mar 30 01:36:37 CET 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Sun Mar 30 01:33:39 2008 +0100| [81e3de1b3a1e02f5724d7add82340a9536a3e875]

video_output: Don't keep the input around for a long time in RunThread.

Else there is a circular dependency between the vout that yield() the input, where the vout is also an input child. This should fix properly the media_instance() tests.

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

 src/video_output/video_output.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index d4794a9..74bcacd 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -780,12 +780,6 @@ static void RunThread( vout_thread_t *p_vout)
         display_date = 0;
         current_date = mdate();
 
-        if( p_input && p_input->b_die )
-        {
-            vlc_object_release( p_input );
-            p_input = NULL;
-        }
-
         i_loops++;
             if( !p_input )
             {
@@ -802,6 +796,8 @@ static void RunThread( vout_thread_t *p_vout)
                                      i_displayed , NULL);
                 i_displayed = i_lost = 0;
                 vlc_mutex_unlock( &p_input->p->counters.counters_lock );
+                vlc_object_release( p_input );
+                p_input = NULL;
             }
 #if 0
         p_vout->c_loops++;
@@ -1058,6 +1054,9 @@ static void RunThread( vout_thread_t *p_vout)
             }
             p_subpic = spu_SortSubpictures( p_vout->p_spu, display_date,
             p_input ? var_GetBool( p_input, "state" ) == PAUSE_S : VLC_FALSE );
+            if( p_input )
+                vlc_object_release( p_input );
+            p_input = NULL;
         }
 
         /*




More information about the vlc-devel mailing list