From 7a290431cf56a54886888d90c9b0aea65a7940de Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Wed, 4 Jun 2014 10:46:41 +0200 Subject: Move all pixmaps into qrc. --- src/dvfile.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/dvfile.cc') 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)); -- cgit v1.2.3