Commit 70c75214 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

[Qt] Fix crash when pressed play when input is DYYYYYING.

Close #2196
parent 3f6bd266
......@@ -428,10 +428,13 @@ void InputManager::sliderUpdate( float new_pos )
void InputManager::togglePlayPause()
{
vlc_value_t state;
if( hasInput() )
{
var_Get( p_input, "state", &state );
state.i_int = ( state.i_int != PLAYING_S ) ? PLAYING_S : PAUSE_S;
var_Set( p_input, "state", state );
emit statusChanged( state.i_int );
}
}
void InputManager::sectionPrev()
......@@ -741,18 +744,16 @@ void MainInputManager::prev()
void MainInputManager::togglePlayPause()
{
if( p_input == NULL )
{
/* No input, play */
if( !p_input )
playlist_Play( THEPL );
return;
}
else
getIM()->togglePlayPause();
}
bool MainInputManager::teletextState()
{
im = getIM();
if( im->hasInput() )
if( getIM()->hasInput() )
{
const int i_teletext_es = var_GetInteger( getInput(), "teletext-es" );
const int i_spu_es = var_GetInteger( getInput(), "spu-es" );
......
......@@ -65,6 +65,8 @@ public:
class InputManager : public QObject
{
Q_OBJECT;
friend class MainInputManager;
public:
InputManager( QObject *, intf_thread_t * );
virtual ~InputManager();
......@@ -107,7 +109,6 @@ private:
public slots:
void setInput( input_thread_t * ); ///< Our controlled input changed
void sliderUpdate( float ); ///< User dragged the slider. We get new pos
void togglePlayPause();
/* SpeedRate Rate Management */
void slower();
void faster();
......@@ -125,6 +126,8 @@ public slots:
/* A to B Loop */
void setAtoB();
private slots:
void togglePlayPause();
signals:
/// Send new position, new time and new length
......
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