[vlc-commits] commit: Fixed vout reuse regression. (Laurent Aimar )

git at videolan.org git at videolan.org
Sun May 23 22:44:58 CEST 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun May 23 22:38:02 2010 +0200| [a61cb21fd61350444abc09c91b55c16d7a4a64cb] | committer: Laurent Aimar 

Fixed vout reuse regression.

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

 include/vlc_vout.h              |    1 +
 src/audio_output/input.c        |    9 +++++----
 src/input/resource.c            |   18 ++++++++++--------
 src/video_output/video_output.c |   15 +++++++++------
 4 files changed, 25 insertions(+), 18 deletions(-)

diff --git a/include/vlc_vout.h b/include/vlc_vout.h
index 51c2190..128bd54 100644
--- a/include/vlc_vout.h
+++ b/include/vlc_vout.h
@@ -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;
diff --git a/src/audio_output/input.c b/src/audio_output/input.c
index 3894e52..a179080 100644
--- a/src/audio_output/input.c
+++ b/src/audio_output/input.c
@@ -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 );
 }
diff --git a/src/input/resource.c b/src/input/resource.c
index a97ff7f..b357cff 100644
--- a/src/input/resource.c
+++ b/src/input/resource.c
@@ -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 );
         }
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index c096d8e..ebf4c4d 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -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;



More information about the vlc-commits mailing list