summaryrefslogtreecommitdiffstats
path: root/helper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'helper.cpp')
-rw-r--r--helper.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/helper.cpp b/helper.cpp
index cfb1711..270feb1 100644
--- a/helper.cpp
+++ b/helper.cpp
@@ -68,7 +68,9 @@ namespace Helper {
QByteArray data(4096, '\0');
do {
read = file.read(data.data(), 4096);
- h.addData(data.data(), read);
+ if(read > 0){
+ h.addData(data.data(), read);
+ }
} while (read == 4096);
QByteArray res = h.result();
retval = res.toHex().toLower();
@@ -214,7 +216,7 @@ namespace Helper {
QSettings s;
QString ffProbe = s.value("paths/ffprobe").toString();
QStringList args;
- QList<QVariant> retval;
+ QList<QVariant> retval = QList<QVariant>() << QVariant() << QVariant();
args << "-show_streams" << path;
QProcess ffproc;
ffproc.start(ffProbe, args);
@@ -229,9 +231,9 @@ namespace Helper {
QString llc = l.toLower();
if(llc.contains("duration")){
int idx = llc.indexOf("duration:");
- retval << llc.mid(idx + 10, 8);
+ retval[0] = llc.mid(idx + 10, 8);
idx = llc.indexOf("bitrate:");
- retval << llc.mid(idx + 9);
+ retval[1] = llc.mid(idx + 9);
break;
}
}