Changeset 175 for smplayer/vendor/current/src/infoprovider.cpp
- Timestamp:
- May 3, 2016, 2:14:41 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
smplayer/vendor/current/src/infoprovider.cpp
r163 r175 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 4Ricardo Villalba <rvm@users.sourceforge.net>2 Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 20 20 #include "global.h" 21 21 #include "preferences.h" 22 #include "mplayerprocess.h" 22 #include "playerprocess.h" 23 #include "playerid.h" 23 24 #include <QFileInfo> 24 25 … … 26 27 qDebug("InfoProvider::getInfo: %s", filename.toUtf8().data()); 27 28 28 MplayerProcess proc;29 30 29 QFileInfo fi(mplayer_bin); 31 32 30 if (fi.exists() && fi.isExecutable() && !fi.isDir()) { 31 mplayer_bin = fi.absoluteFilePath(); 33 32 } 34 33 35 proc.addArgument(mplayer_bin); 36 proc.addArgument("-identify"); 37 proc.addArgument("-frames"); 38 proc.addArgument("0"); 39 proc.addArgument("-vo"); 40 proc.addArgument("null"); 41 proc.addArgument("-ao"); 42 proc.addArgument("null"); 43 proc.addArgument(filename); 34 PlayerProcess * proc = PlayerProcess::createPlayerProcess(mplayer_bin, 0); 44 35 45 proc.start(); 46 if (!proc.waitForFinished()) { 36 proc->setExecutable(mplayer_bin); 37 proc->setFixedOptions(); 38 proc->setOption("frames", "1"); 39 proc->setOption("vo", "null"); 40 proc->setOption("ao", "null"); 41 #ifdef Q_OS_WIN 42 proc->setOption("fontconfig", false); 43 #endif 44 proc->setMedia(filename); 45 46 QString commandline = proc->arguments().join(" "); 47 qDebug("InfoProvider::getInfo: command: '%s'", commandline.toUtf8().data()); 48 49 proc->start(); 50 if (!proc->waitForFinished()) { 47 51 qWarning("InfoProvider::getInfo: process didn't finish. Killing it..."); 48 proc .kill();52 proc->kill(); 49 53 } 50 54 51 return proc.mediaData(); 55 MediaData md = proc->mediaData(); 56 delete proc; 57 58 return md; 52 59 } 53 60
Note:
See TracChangeset
for help on using the changeset viewer.