diff options
author | Daniel Meyerholt <dxm523@googlemail.com> | 2011-02-19 15:35:27 +0100 |
---|---|---|
committer | Daniel Meyerholt <dxm523@googlemail.com> | 2011-02-19 15:35:27 +0100 |
commit | cda1b1cd156895f943612ca4961514b15e639553 (patch) | |
tree | 3ff0e561ab2b3325bd8e1da82f4428ae1121ed82 | |
parent | 85e25976e0c75eb5118dcea7bd8c462e9b0769d4 (diff) | |
download | vdr-plugin-vdrrip-cda1b1cd156895f943612ca4961514b15e639553.tar.gz vdr-plugin-vdrrip-cda1b1cd156895f943612ca4961514b15e639553.tar.bz2 |
* Now really reading RecordingInfo (before only got default fps)
-rwxr-xr-x | movie.c | 24 |
1 files changed, 18 insertions, 6 deletions
@@ -494,12 +494,24 @@ const char* cMovie::getPPValues() {return PPValues;} void cMovie::setLengthVDR() { - cRecordingInfo *crec= new cRecordingInfo(Dir); - cIndexFile *ifile = new cIndexFile(Dir,false,OldRecording); - Length = ifile->Last()/ crec->FramesPerSecond(); - delete(ifile); - delete(crec); - dsyslog ("[vdrrip] length: %i ",Length); + char *infoFile = NULL; + asprintf(&infoFile, "%s%s", Dir, OldRecording ? "/info.vdr" : "/info"); + dsyslog ("[vdrrip] reading recording info %s ",infoFile); + cRecordingInfo *crec = new cRecordingInfo(Dir); + FILE *f = fopen(infoFile, "r"); + if (crec->Read(f)) { + cIndexFile *ifile = new cIndexFile(Dir, false, OldRecording); + Length = ifile->Last() / crec->FramesPerSecond(); + delete (ifile); + dsyslog("[vdrrip] parsed index && info"); + } else { + dsyslog ("[vdrrip] failed reading info"); + Length = 10; + } + delete (crec); + FREE (infoFile); + fclose(f); + dsyslog ("[vdrrip] length: %i seconds ",Length); } //TODO: maybe get these out of cRecordingInfo et al. ? |