Fixed vout reuse regression.
authorLaurent Aimar <fenrir@videolan.org>
Sun, 23 May 2010 20:38:02 +0000 (22:38 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Sun, 23 May 2010 20:38:02 +0000 (22:38 +0200)
include/vlc_vout.h
src/audio_output/input.c
src/input/resource.c
src/video_output/video_output.c

index 51c2190..128bd54 100644 (file)
@@ -53,6 +53,7 @@
 typedef struct {
     vout_thread_t        *vout;
     vlc_object_t         *input;
+    bool                 change_fmt;
     const video_format_t *fmt;
     unsigned             dpb_size;
 } vout_configuration_t;
index 3894e52..a179080 100644 (file)
@@ -816,10 +816,11 @@ static vout_thread_t *RequestVout( void *p_private,
     aout_instance_t *p_aout = p_private;
     VLC_UNUSED(b_recycle);
     vout_configuration_t cfg = {
-        .vout     = p_vout,
-        .input    = NULL,
-        .fmt      = p_fmt,
-        .dpb_size = 1,
+        .vout       = p_vout,
+        .input      = NULL,
+        .change_fmt = true,
+        .fmt        = p_fmt,
+        .dpb_size   = 1,
     };
     return vout_Request( p_aout, &cfg );
 }
index a97ff7f..b357cff 100644 (file)
@@ -244,10 +244,11 @@ static vout_thread_t *RequestVout( input_resource_t *p_resource,
 
         /* */
         vout_configuration_t cfg = {
-            .vout     = p_vout,
-            .input    = VLC_OBJECT(p_resource->p_input),
-            .fmt      = p_fmt,
-            .dpb_size = dpb_size,
+            .vout       = p_vout,
+            .input      = VLC_OBJECT(p_resource->p_input),
+            .change_fmt = true,
+            .fmt        = p_fmt,
+            .dpb_size   = dpb_size,
         };
         p_vout = vout_Request( p_resource->p_input, &cfg );
         if( !p_vout )
@@ -283,10 +284,11 @@ static vout_thread_t *RequestVout( input_resource_t *p_resource,
             vout_FlushSubpictureChannel( p_vout, -1 );
 
             vout_configuration_t cfg = {
-                .vout     = p_vout,
-                .input    = NULL,
-                .fmt      = p_fmt,
-                .dpb_size = 0,
+                .vout       = p_vout,
+                .input      = NULL,
+                .change_fmt = false,
+                .fmt        = NULL,
+                .dpb_size   = 0,
             };
             p_resource->p_vout_free = vout_Request( p_resource->p_input, &cfg );
         }
index c096d8e..ebf4c4d 100644 (file)
@@ -178,7 +178,7 @@ vout_thread_t *(vout_Request)(vlc_object_t *object,
                               const vout_configuration_t *cfg)
 {
     vout_thread_t *vout = cfg->vout;
-    if (!cfg->fmt) {
+    if (cfg->change_fmt && !cfg->fmt) {
         if (vout)
             vout_CloseAndRelease(vout);
         return NULL;
@@ -197,12 +197,15 @@ vout_thread_t *(vout_Request)(vlc_object_t *object,
                 spu_Attach(vout->p->p_spu, vout->p->input, true);
         }
 
-        vout_control_cmd_t cmd;
-        vout_control_cmd_Init(&cmd, VOUT_CONTROL_REINIT);
-        cmd.u.cfg = cfg;
+        if (cfg->change_fmt) {
+            vout_control_cmd_t cmd;
+            vout_control_cmd_Init(&cmd, VOUT_CONTROL_REINIT);
+            cmd.u.cfg = cfg;
+
+            vout_control_Push(&vout->p->control, &cmd);
+            vout_control_WaitEmpty(&vout->p->control);
+        }
 
-        vout_control_Push(&vout->p->control, &cmd);
-        vout_control_WaitEmpty(&vout->p->control);
         if (!vout->p->dead) {
             msg_Dbg(object, "reusing provided vout");
             return vout;