summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjaromil <jaromil@949728d9-16ea-0310-a75c-cbdf8430a4b8>2005-11-03 12:23:37 (GMT)
committer jaromil <jaromil@949728d9-16ea-0310-a75c-cbdf8430a4b8>2005-11-03 12:23:37 (GMT)
commit24a2282f30627cbb882f1c2613721948a63b7ffc (patch)
tree112dfe721ab2ae00a2426f7a07d085cebe9b197e
parent9734d36049c5a9c93a6056f3b2ecefc1529ff324 (diff)
final working fix for large files playing,
fix for non-scheduled playlists, ready for Erwin Olaf installation (museumnacht 2005) git-svn-id: svn://dyne.org/montevideo/ivysync@46 949728d9-16ea-0310-a75c-cbdf8430a4b8
-rw-r--r--decoder.cpp36
1 files changed, 23 insertions, 13 deletions
diff --git a/decoder.cpp b/decoder.cpp
index c091cd5..3a138eb 100644
--- a/decoder.cpp
+++ b/decoder.cpp
@@ -171,9 +171,9 @@ void Decoder::run() {
playlist_fd = fopen( movie.c_str(), "rb" );
if(!playlist_fd) {
- E("can't open %s: %s", movie.c_str(), strerror(errno));
+ E("can't open %s: %s (%i)", movie.c_str(), strerror(errno), errno);
- if(errno==EOVERFLOW) {
+ if(errno==27) { // EOVERFLOW - file too large
int tmpfd;
tmpfd = open( movie.c_str(), O_RDONLY|O_LARGEFILE);
@@ -343,6 +343,9 @@ int playlist_selector(const struct dirent *dir) {
if( strstr(dir->d_name, today_str) )
return 1;
+ if( strstr(dir->d_name, "video") )
+ return 1;
+
return 0;
}
@@ -403,20 +406,27 @@ int Decoder::load() {
if( ! strstr( filelist[found]->d_name, videodev ) ) continue;
// read and check the exact time on the filename
- get_time( filelist[found]->d_name, &pltime );
+ // in case the playlist filename doesn't starts with video*
+ if ( filelist[found]->d_name[0] == 'v') {
+
+ snprintf(ThePlaylist,511,"%s",filelist[found]->d_name);
+
+ } else {
+
+ get_time( filelist[found]->d_name, &pltime );
- // skip if we already have a more recent playlist
- if(plseltime.tm_hour > pltime.tm_hour) continue;
- else if(plseltime.tm_hour == pltime.tm_hour)
- if(plseltime.tm_min >= pltime.tm_min) continue;
+ // skip if we already have a more recent playlist
+ if(plseltime.tm_hour > pltime.tm_hour) continue;
+ else if(plseltime.tm_hour == pltime.tm_hour)
+ if(plseltime.tm_min >= pltime.tm_min) continue;
- if(now.tm_hour > pltime.tm_hour) {
+ if(now.tm_hour > pltime.tm_hour) {
- D("this playlist is actual, we're going to use this");
- snprintf(ThePlaylist,511,"%s",filelist[found]->d_name);
- memcpy(&plseltime,&pltime,sizeof(struct tm));
+ D("this playlist is actual, we're going to use this");
+ snprintf(ThePlaylist,511,"%s",filelist[found]->d_name);
+ memcpy(&plseltime,&pltime,sizeof(struct tm));
- } else if(now.tm_hour == pltime.tm_hour) {
+ } else if(now.tm_hour == pltime.tm_hour) {
// same hour, let's check the minutes
if(now.tm_min >= pltime.tm_min) {
@@ -427,7 +437,7 @@ int Decoder::load() {
}
} else D("this playlist will be activated later");
-
+ }
}
snprintf(path,511,"%s/.ivysync/%s",home,ThePlaylist);