Commit a101344f authored by Mal Graty's avatar Mal Graty Committed by Jean-Baptiste Kempf

Playlist status not being updated on play/pause

Fix issue #4899

The problem was that the playing/paused state was being misreported
to the luahttp interface, turns out this was due to the way the playing
state was being updated in the Qt and hotkey logic.

The p_input state was being updated, but the playlist wasn't being
informed, this patch switches out the p_state calls to use the
equivalent playlist aware functions.
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit 48a98edcc66626a2292f8c9f8d697fa8244736af)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 1940c29a
...@@ -301,17 +301,8 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -301,17 +301,8 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
ClearChannels( p_intf, p_vout ); ClearChannels( p_intf, p_vout );
int state = var_GetInteger( p_input, "state" ); int state = var_GetInteger( p_input, "state" );
if( state != PAUSE_S ) DisplayIcon( p_vout, state != PAUSE_S ? OSD_PAUSE_ICON : OSD_PLAY_ICON );
{ playlist_Pause( p_playlist );
DisplayIcon( p_vout, OSD_PAUSE_ICON );
state = PAUSE_S;
}
else
{
DisplayIcon( p_vout, OSD_PLAY_ICON );
state = PLAYING_S;
}
var_SetInteger( p_input, "state", state );
} }
else else
playlist_Play( p_playlist ); playlist_Play( p_playlist );
......
...@@ -737,17 +737,6 @@ void InputManager::sliderUpdate( float new_pos ) ...@@ -737,17 +737,6 @@ void InputManager::sliderUpdate( float new_pos )
emit seekRequested( new_pos ); emit seekRequested( new_pos );
} }
/* User togglePlayPause */
void InputManager::togglePlayPause()
{
if( hasInput() )
{
int state = var_GetInteger( p_input, "state" );
state = ( state != PLAYING_S ) ? PLAYING_S : PAUSE_S;
var_SetInteger( p_input, "state", state );
}
}
void InputManager::sectionPrev() void InputManager::sectionPrev()
{ {
if( hasInput() ) if( hasInput() )
...@@ -1121,7 +1110,7 @@ void MainInputManager::togglePlayPause() ...@@ -1121,7 +1110,7 @@ void MainInputManager::togglePlayPause()
if( !p_input ) if( !p_input )
playlist_Play( THEPL ); playlist_Play( THEPL );
else else
getIM()->togglePlayPause(); playlist_Pause( THEPL );
} }
void MainInputManager::play() void MainInputManager::play()
...@@ -1133,7 +1122,7 @@ void MainInputManager::play() ...@@ -1133,7 +1122,7 @@ void MainInputManager::play()
{ {
if( PLAYING_S != var_GetInteger( p_input, "state" ) ) if( PLAYING_S != var_GetInteger( p_input, "state" ) )
{ {
getIM()->togglePlayPause(); playlist_Pause( THEPL );
} }
} }
} }
...@@ -1142,7 +1131,7 @@ void MainInputManager::pause() ...@@ -1142,7 +1131,7 @@ void MainInputManager::pause()
{ {
if(p_input && PLAYING_S == var_GetInteger( p_input, "state" ) ) if(p_input && PLAYING_S == var_GetInteger( p_input, "state" ) )
{ {
getIM()->togglePlayPause(); playlist_Pause( THEPL );
} }
} }
......
...@@ -207,7 +207,6 @@ public slots: ...@@ -207,7 +207,6 @@ public slots:
void setAtoB(); void setAtoB();
private slots: private slots:
void togglePlayPause();
void AtoBLoop( float, int64_t, int ); void AtoBLoop( float, int64_t, int );
signals: signals:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment