+ if (m_skipmode_m)
+ {
+ int frames_to_skip = m_skipmode_frames + m_skipmode_frames_remainder;
+ eDebug("we are at %llx, and we try to skip %d+%d frames from here", current_offset, m_skipmode_frames, m_skipmode_frames_remainder);
+ size_t iframe_len;
+ off_t iframe_start = current_offset;
+ int frames_skipped = frames_to_skip;
+ if (!m_tstools.findNextPicture(iframe_start, iframe_len, frames_skipped))
+ {
+ m_skipmode_frames_remainder = frames_to_skip - frames_skipped;
+ eDebug("successfully skipped %d (out of %d, rem now %d) frames.", frames_skipped, frames_to_skip, m_skipmode_frames_remainder);
+ current_offset = align_with_len(iframe_start, blocksize, iframe_len);
+ max = align(iframe_len + 187, blocksize);
+ frame_skip_success = 1;
+ } else
+ {
+ m_skipmode_frames_remainder = 0;
+ eDebug("frame skipping failed, reverting to byte-skipping");
+ }
+ }
+
+ if (!frame_skip_success)
+ {
+ current_offset += align(m_skipmode_m, blocksize);
+
+ if (m_skipmode_m)
+ {
+ eDebug("we are at %llx, and we try to find the iframe here:", current_offset);
+ size_t iframe_len;
+ off_t iframe_start = current_offset;
+
+ int direction = (m_skipmode_m < 0) ? -1 : +1;
+ if (m_tstools.findFrame(iframe_start, iframe_len, direction))
+ eDebug("failed");
+ else
+ {
+ current_offset = align_with_len(iframe_start, blocksize, iframe_len);
+ max = align(iframe_len, blocksize);
+ }
+ }
+ }