From 48b768db44cb9e00adfead71b973074685cec417 Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 20 Sep 2005 19:39:49 +0000 Subject: *** empty log message *** --- src/dvfile.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/dvfile.cc') diff --git a/src/dvfile.cc b/src/dvfile.cc index a0dccf3..7eab867 100644 --- a/src/dvfile.cc +++ b/src/dvfile.cc @@ -35,6 +35,7 @@ dvfile::dvfile(Info* i) { info = i; fp = fopen(TEST_MOVIE, "r"); + if(!fp) info->error("Couldn't open %s for reading.", TEST_MOVIE); } dvfile::~dvfile() @@ -51,8 +52,12 @@ unsigned char *dvfile::readFrame() ts.tv_nsec = 1000000000L / 25L; // 1/25s nanosleep(&ts, NULL); - while(fread(frame, DVPACKAGE_SIZE, 1, fp) == 0) { - fseek(fp, 0L, SEEK_SET); + if(fp) { + while(fread(frame, DVPACKAGE_SIZE, 1, fp) == 0) { + fseek(fp, 0L, SEEK_SET); + } + } else { + memset(frame, 0, sizeof(frame)); } return frame; -- cgit v1.2.3