Commit 2ddb1937 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Cleaner fix for dvgrab timestamp issue (disable option in settings dialog if dvgrab < 3.3)

http://www.kdenlive.org/mantis/view.php?id=338

svn path=/branches/KDE4/; revision=2674
parent f4d53aff
......@@ -121,6 +121,25 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(QWidget * parent): KConfigDialog(
m_audioDevice = KdenliveSettings::audio_device();
initDevices();
connect(m_configMisc.kcfg_profiles_list, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateDisplay()));
//HACK: check dvgrab version, because only dvgrab >= 3.3 supports
// --timestamp option without bug
double dvgrabVersion = 0;
QProcess *versionCheck = new QProcess;
versionCheck->setProcessChannelMode(QProcess::MergedChannels);
versionCheck->start("dvgrab", QStringList() << "--version");
if (versionCheck->waitForFinished()) {
QString version = QString(versionCheck->readAll()).simplified();
if (version.contains(' ')) version = version.section(' ', -1);
dvgrabVersion = version.toDouble();
kDebug() << "// FOUND DVGRAB VERSION: " << dvgrabVersion;
}
if (versionCheck) delete versionCheck;
if (dvgrabVersion < 3.3) {
KdenliveSettings::setFirewiretimestamp(false);
m_configCapture.kcfg_firewiretimestamp->setEnabled(false);
}
}
KdenliveSettingsDialog::~KdenliveSettingsDialog() {}
......
......@@ -39,7 +39,7 @@
#include "recmonitor.h"
RecMonitor::RecMonitor(QString name, QWidget *parent)
: QWidget(parent), m_name(name), m_isActive(false), m_isCapturing(false), m_isPlaying(false), m_didCapture(false), m_dvgrabVersion(0) {
: QWidget(parent), m_name(name), m_isActive(false), m_isCapturing(false), m_isPlaying(false), m_didCapture(false) {
ui.setupUi(this);
ui.video_frame->setAttribute(Qt::WA_PaintOnScreen);
......@@ -117,19 +117,6 @@ RecMonitor::RecMonitor(QString name, QWidget *parent)
KdenliveSettings::setVideo4playback(playbackCommand);
}
//HACK: check dvgrab version, because only dvgrab >= 3.3 supports
// --timestamp option without bug
QProcess *versionCheck = new QProcess;
versionCheck->setProcessChannelMode(QProcess::MergedChannels);
versionCheck->start("dvgrab", QStringList() << "--version");
if (versionCheck->waitForFinished()) {
QString version = QString(versionCheck->readAll()).simplified();
if (version.contains(' ')) version = version.section(' ', -1);
m_dvgrabVersion = version.toDouble();
kDebug() << "// FOUND DVGRAB VERSION: " << m_dvgrabVersion;
}
if (versionCheck) delete versionCheck;
kDebug() << "/////// BUILDING MONITOR, ID: " << ui.video_frame->winId();
}
......@@ -343,7 +330,7 @@ void RecMonitor::slotStartCapture(bool play) {
break;
}
if (KdenliveSettings::firewireautosplit()) m_captureArgs << "--autosplit";
if (KdenliveSettings::firewiretimestamp() && m_dvgrabVersion >= 3.3) m_captureArgs << "--timestamp";
if (KdenliveSettings::firewiretimestamp()) m_captureArgs << "--timestamp";
m_captureArgs << "-i" << "capture" << "-";
m_displayArgs << "-x" << QString::number(ui.video_frame->width()) << "-y" << QString::number(ui.video_frame->height()) << "-";
......
......@@ -56,7 +56,6 @@ private:
RegionGrabber *rgnGrab;
bool m_isActive;
KDateTime m_captureTime;
double m_dvgrabVersion;
KUrl m_captureFile;
KIcon m_playIcon;
......
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