summaryrefslogtreecommitdiff
path: root/src/dvfile.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2014-06-04 10:46:41 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2014-06-04 10:46:41 +0200
commit7a290431cf56a54886888d90c9b0aea65a7940de (patch)
tree80c5ee81f0e671a9f7f6390c6e8065dc505af60d /src/dvfile.cc
parent9fa8ce5d62a24efa4e5b584f5a6cf921e3052be8 (diff)
Move all pixmaps into qrc.
Diffstat (limited to 'src/dvfile.cc')
-rw-r--r--src/dvfile.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/dvfile.cc b/src/dvfile.cc
index b942e42..b7c7f47 100644
--- a/src/dvfile.cc
+++ b/src/dvfile.cc
@@ -32,15 +32,17 @@
#include "util.h"
dvfile::dvfile(Info* i)
+ : fp(QString(TEST_MOVIE))
{
info = i;
- fp = fopen(TEST_MOVIE, "r");
- if(!fp) info->error("Couldn't open %s for reading.", TEST_MOVIE);
+ if(!fp.open(QIODevice::ReadOnly)) {
+ info->error("Couldn't open %s for reading.", TEST_MOVIE);
+ }
}
dvfile::~dvfile()
{
- fclose(fp);
+ fp.close();
}
unsigned char *dvfile::readFrame()
@@ -49,9 +51,9 @@ unsigned char *dvfile::readFrame()
sleep_1_frame();
- if(fp) {
- while(fread(frame, DVPACKAGE_SIZE, 1, fp) == 0) {
- fseek(fp, 0L, SEEK_SET);
+ if(fp.isReadable()) {
+ while(fp.read((char *)frame, DVPACKAGE_SIZE) == 0) {
+ fp.seek(0);
}
} else {
memset(frame, 0, sizeof(frame));