[vlc-devel] [PATCH 7/9] omxil: Don't do a full reconfigure for all settings changed events

Martin Storsjö martin at martin.st
Wed Apr 4 14:17:58 CEST 2012


Only do it for the right events.
---
 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:
-- 
1.7.2.5




More information about the vlc-devel mailing list