1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-13 09:34:53 +02:00

Use constant c-style array instead of fancy Qt data structures

This commit is contained in:
Uwe L. Korn
2014-10-21 22:57:05 +02:00
parent b6f92013bd
commit f0e2ddcdf0

View File

@@ -72,33 +72,24 @@ AudioOutput::AudioOutput( QObject* parent )
qRegisterMetaType<AudioOutput::AudioState>("AudioOutput::AudioState"); qRegisterMetaType<AudioOutput::AudioState>("AudioOutput::AudioState");
QList<QByteArray> args; const char* vlcArgs[] = {
"--ignore-config",
args << "--ignore-config"; "--extraintf=logger",
args << "--extraintf=logger"; qApp->arguments().contains( "--verbose" ) ? "--verbose=3" : "",
if ( qApp->arguments().contains( "--verbose" ) ) { // "--no-plugins-cache",
args << "--verbose=3"; // "--no-media-library",
} // "--no-osd",
/* // "--no-stats",
args << "--no-plugins-cache"; // "--no-video-title-show",
args << "--no-media-library"; // "--no-snapshot-preview",
args << "--no-osd"; // "--services-discovery=''",
args << "--no-stats"; "--no-video",
args << "--no-video-title-show"; "--no-xlib"
args << "--no-snapshot-preview"; };
args << "--services-discovery=''";
*/
args << "--no-video";
args << "--no-xlib";
QVarLengthArray< const char * , 64 > vlcArgs( args.size() );
for ( int i = 0 ; i < args.size() ; ++i ) {
vlcArgs[i] = args.at( i ).constData();
tDebug() << args.at( i );
}
// Create and initialize a libvlc instance (it should be done only once) // Create and initialize a libvlc instance (it should be done only once)
if ( !( vlcInstance = libvlc_new( vlcArgs.size(), vlcArgs.constData() ) ) ) { vlcInstance = libvlc_new( sizeof(vlcArgs) / sizeof(*vlcArgs), vlcArgs );
if ( !vlcInstance ) {
tDebug() << "libVLC: could not initialize"; tDebug() << "libVLC: could not initialize";
} }