[vlc-commits] omxil: Don't do a full reconfigure for all settings changed events

Martin Storsjö git at videolan.org
Wed Apr 4 15:08:29 CEST 2012


vlc | branch: master | Martin Storsjö <martin at martin.st> | Wed Apr  4 15:17:58 2012 +0300| [f27586eff68ee97db3e13097227f457e75b5b2ef] | committer: Jean-Baptiste Kempf

omxil: Don't do a full reconfigure for all settings changed events

Only do it for the right events.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/codec/omxil/omxil.c |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/modules/codec/omxil/omxil.c b/modules/codec/omxil/omxil.c
index 9d6a738..047b8ff 100644
--- a/modules/codec/omxil/omxil.c
+++ b/modules/codec/omxil/omxil.c
@@ -1630,12 +1630,19 @@ static OMX_ERRORTYPE OmxEventHandler( OMX_HANDLETYPE omx_handle,
     case OMX_EventPortSettingsChanged:
         msg_Dbg( p_dec, "OmxEventHandler (%s, %u, %u)", EventToString(event),
                  (unsigned int)data_1, (unsigned int)data_2 );
-        for(i = 0; i < p_sys->ports; i++)
-            if(p_sys->p_ports[i].definition.eDir == OMX_DirOutput)
-                p_sys->p_ports[i].b_reconfigure = true;
-        memset(&p_sys->sentinel_buffer, 0, sizeof(p_sys->sentinel_buffer));
-        p_sys->sentinel_buffer.nFlags = OMX_BUFFERFLAG_EOS;
-        OMX_FIFO_PUT(&p_sys->in.fifo, &p_sys->sentinel_buffer);
+        if( data_2 == 0 || data_2 == OMX_IndexParamPortDefinition )
+        {
+            for(i = 0; i < p_sys->ports; i++)
+                if(p_sys->p_ports[i].definition.eDir == OMX_DirOutput)
+                    p_sys->p_ports[i].b_reconfigure = true;
+            memset(&p_sys->sentinel_buffer, 0, sizeof(p_sys->sentinel_buffer));
+            p_sys->sentinel_buffer.nFlags = OMX_BUFFERFLAG_EOS;
+            OMX_FIFO_PUT(&p_sys->in.fifo, &p_sys->sentinel_buffer);
+        }
+        else
+        {
+            msg_Dbg( p_dec, "Unhandled setting change %x", (unsigned int)data_2 );
+        }
         break;
 
     default:



More information about the vlc-commits mailing list