fix skipping forward/backward
authorghost <andreas.monzner@multimedia-labs.de>
Thu, 3 Sep 2009 14:33:42 +0000 (16:33 +0200)
committerghost <andreas.monzner@multimedia-labs.de>
Thu, 3 Sep 2009 14:33:42 +0000 (16:33 +0200)
lib/dvb/tstools.cpp

index 06e8ba0f33af12efcc897b41fe01240ce076f5a5..a9eef4067e703bdd3db650f6e16fd8fb078226c5 100644 (file)
@@ -662,7 +662,8 @@ int eDVBTSTools::findNextPicture(off_t &offset, size_t &len, int &distance, int
        
        off_t new_offset = offset;
        size_t new_len = len;
-       
+       int first = 1;
+
        while (distance > 0)
        {
                int dir = direction;
@@ -676,8 +677,9 @@ int eDVBTSTools::findNextPicture(off_t &offset, size_t &len, int &distance, int
                
 //             eDebug("we moved %d, %d to go frames (now at %llx)", dir, distance, new_offset);
 
-               if (distance >= 0)
+               if (distance >= 0 || first)
                {
+                       first = 0;
                        offset = new_offset;
                        len = new_len;
                        nr_frames += abs(dir);