]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/input_manager.cpp
Qt4: don't reset rate when input changes
[vlc] / modules / gui / qt4 / input_manager.cpp
index 02610d1e238d4aaf154cada9cfea9c5d5ad73ead..516105ca7f0306225a60b501776cc5899ea382f2 100644 (file)
@@ -23,6 +23,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+#define __STDC_FORMAT_MACROS 1
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
@@ -112,7 +114,9 @@ void InputManager::setInput( input_thread_t *_p_input )
         UpdateVout();
 
         p_item = input_GetItem( p_input );
-        emit rateChanged( var_GetFloat( p_input, "rate" ) );
+
+        var_SetFloat( p_input, "rate", f_rate );
+        emit rateChanged( f_rate );
     }
     else
     {
@@ -139,7 +143,6 @@ void InputManager::delInput()
     b_video              = false;
     timeA                = 0;
     timeB                = 0;
-    f_rate               = 1. ;
 
     if( p_input_vbi )
     {
@@ -257,6 +260,9 @@ void InputManager::customEvent( QEvent *event )
     case ProgramChanged_Type:
         UpdateProgramEvent();
         break;
+    case EPGEvent_Type:
+        UpdateEPG();
+        break;
     default:
         msg_Warn( p_intf, "This shouldn't happen: %i", i_type );
         assert(0);
@@ -361,6 +367,11 @@ static int InputEvent( vlc_object_t *p_this, const char *,
         event = new IMEvent( ProgramChanged_Type );
         break;
 
+    case INPUT_EVENT_ITEM_EPG:
+        /* EPG data changed */
+        event = new IMEvent( EPGEvent_Type );
+        break;
+
     case INPUT_EVENT_SIGNAL:
         /* This is for capture-card signals */
         /* event = new IMEvent( SignalChanged_Type );
@@ -409,11 +420,11 @@ void InputManager::UpdateNavigation()
     if( val.i_int > 0 )
     {
         emit titleChanged( true );
-        msg_Dbg( p_intf, "Title %i", val.i_int );
+        msg_Dbg( p_intf, "Title %"PRId64, val.i_int );
         /* p_input != NULL since val.i_int != 0 */
         var_Change( p_input, "chapter", VLC_VAR_CHOICESCOUNT, &val2, NULL );
         emit chapterChanged( (val2.i_int > 1) || ( val2.i_int > 0 && val.i_int > 1 ) );
-        msg_Dbg( p_intf, "Chapter: %i", val2.i_int );
+        msg_Dbg( p_intf, "Chapter: %"PRId64, val2.i_int );
     }
     else
         emit titleChanged( false );
@@ -547,12 +558,20 @@ void InputManager::UpdateTeletext()
     }
 }
 
+void InputManager::UpdateEPG()
+{
+    if( hasInput() )
+    {
+       emit epgChanged();
+    }
+}
+
 void InputManager::UpdateVout()
 {
     if( hasInput() )
     {
         /* Get current vout lists from input */
-        int i_vout;
+        size_t i_vout;
         vout_thread_t **pp_vout;
         if( input_Control( p_input, INPUT_GET_VOUTS, &pp_vout, &i_vout ) )
         {
@@ -625,7 +644,10 @@ const QString InputManager::decodeArtURL( input_item_t *p_item )
     /* Taglib seems to define a attachment://, It won't work yet */
     url = url.replace( "attachment://", "" );
 #endif
-    return qfu( psz_art ? psz_art : "" );
+
+    QString path = qfu( psz_art ? psz_art : "" );
+    free( psz_art );
+    return path;
 }
 
 void InputManager::UpdateArt()