Commit 72798bda authored by Ludovic Fauvet's avatar Ludovic Fauvet
Browse files

Fix segfault

parent 0dc91621
...@@ -29,12 +29,12 @@ ...@@ -29,12 +29,12 @@
#include <QDir> #include <QDir>
#include "Transcode.h" #include "Transcode.h"
static bool catchVLCException(libvlc_exception_t *ex) static bool catchVLCException( libvlc_exception_t *ex )
{ {
if (libvlc_exception_raised(ex)) if ( libvlc_exception_raised( ex ) )
{ {
qDebug() << libvlc_exception_get_message(ex); qDebug() << libvlc_exception_get_message( ex );
libvlc_exception_clear(ex); libvlc_exception_clear( ex );
return (true); return (true);
} }
return (false); return (false);
...@@ -44,7 +44,7 @@ Transcode *Transcode::m_instance = NULL; ...@@ -44,7 +44,7 @@ Transcode *Transcode::m_instance = NULL;
Transcode *Transcode::instance( QWidget *parent ) Transcode *Transcode::instance( QWidget *parent )
{ {
if (Transcode::m_instance == NULL) if ( !Transcode::m_instance )
Transcode::m_instance = new Transcode( parent ); Transcode::m_instance = new Transcode( parent );
return ( Transcode::m_instance ); return ( Transcode::m_instance );
} }
...@@ -79,12 +79,6 @@ Transcode::Transcode( QWidget *parent ) ...@@ -79,12 +79,6 @@ Transcode::Transcode( QWidget *parent )
SLOT( deleteLater() ) ); SLOT( deleteLater() ) );
} }
Transcode::~Transcode()
{
if ( m_instance )
delete m_instance;
}
void Transcode::on_browseFileButton_clicked() void Transcode::on_browseFileButton_clicked()
{ {
QString path = QFileDialog::getOpenFileName( this, QString path = QFileDialog::getOpenFileName( this,
...@@ -99,7 +93,7 @@ void Transcode::on_browseFileButton_clicked() ...@@ -99,7 +93,7 @@ void Transcode::on_browseFileButton_clicked()
bool Transcode::m_doTranscode( const QString &transStr ) bool Transcode::m_doTranscode( const QString &transStr )
{ {
QString sout(":sout="); QString sout( ":sout=" );
sout += transStr; sout += transStr;
char const *vlc_argv[] = char const *vlc_argv[] =
...@@ -168,8 +162,8 @@ void Transcode::m_releaseVLCRessources() ...@@ -168,8 +162,8 @@ void Transcode::m_releaseVLCRessources()
void Transcode::m_callback(const libvlc_event_t *event, void *ptr) void Transcode::m_callback(const libvlc_event_t *event, void *ptr)
{ {
Transcode* self = reinterpret_cast<Transcode*>(ptr); Transcode* self = reinterpret_cast<Transcode*>( ptr );
switch (event->type) switch ( event->type )
{ {
case libvlc_MediaPlayerEndReached: case libvlc_MediaPlayerEndReached:
self->m_running = false; self->m_running = false;
...@@ -265,7 +259,7 @@ void Transcode::on_deleteProfile_clicked() ...@@ -265,7 +259,7 @@ void Transcode::on_deleteProfile_clicked()
void Transcode::calcTranscodePercentage() void Transcode::calcTranscodePercentage()
{ {
m_progress->setValue(10); m_progress->setValue( 10 );
if ( !m_running ) if ( !m_running )
{ {
m_timer->stop(); m_timer->stop();
......
...@@ -44,7 +44,6 @@ class Transcode : public QDialog ...@@ -44,7 +44,6 @@ class Transcode : public QDialog
private: private:
explicit Transcode( QWidget *parent = 0 ); explicit Transcode( QWidget *parent = 0 );
~Transcode();
bool m_doTranscode( const QString &transStr ); bool m_doTranscode( const QString &transStr );
void m_initProgressDialog(); void m_initProgressDialog();
void m_releaseVLCRessources(); void m_releaseVLCRessources();
......
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