summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjaromil <jaromil@949728d9-16ea-0310-a75c-cbdf8430a4b8>2005-11-03 12:01:01 (GMT)
committer jaromil <jaromil@949728d9-16ea-0310-a75c-cbdf8430a4b8>2005-11-03 12:01:01 (GMT)
commit9734d36049c5a9c93a6056f3b2ecefc1529ff324 (patch)
tree5a182b62ef9608412dcbfd851501d39734ba91a4
parent88bc74398424605710bcc959ff3cd1247cf83357 (diff)
fix for opening large files (>2GB)
git-svn-id: svn://dyne.org/montevideo/ivysync@45 949728d9-16ea-0310-a75c-cbdf8430a4b8
-rw-r--r--decoder.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/decoder.cpp b/decoder.cpp
index 0dc12c7..c091cd5 100644
--- a/decoder.cpp
+++ b/decoder.cpp
@@ -172,8 +172,22 @@ void Decoder::run() {
playlist_fd = fopen( movie.c_str(), "rb" );
if(!playlist_fd) {
E("can't open %s: %s", movie.c_str(), strerror(errno));
- update();
- continue;
+
+ if(errno==EOVERFLOW) {
+
+ int tmpfd;
+ tmpfd = open( movie.c_str(), O_RDONLY|O_LARGEFILE);
+
+ if(!tmpfd) {
+ E("failed opening with largefile support: %s",strerror(errno));
+ update();
+ continue;
+ } else playlist_fd = fdopen( tmpfd , "rb" );
+
+ } else {
+ update();
+ continue;
+ }
}
N("now playing %s",movie.c_str());