+ if (is_mpeg) //MPEG2 picture start code with I-frame
+ {
+ off_t sequence_offset = start;
+ unsigned long long sequence_data;
+ int is_sequence =0;
+ int frame_length = (nr_frames<0) ? -nr_frames: nr_frames;
+ while(frame_length)
+ {
+// --start;
+ if (m_streaminfo.getStructureEntry_prev(sequence_offset, sequence_data))
+ {
+ eDebug("get previous failed");
+ return -1;
+ }
+ if ((sequence_data & 0xFF) == 0xB3) /* sequence start or previous frame */
+ is_sequence = 1;
+ if(((sequence_data & 0xFF) == 0x0009) || ((sequence_data & 0xFF) == 0x00)) /* H.264 UAD or MPEG2 start code */
+ --frame_length;
+// eDebug("[findFrame] %08llx@%llu -> %d, %d (sequence)", sequence_data, sequence_offset, is_sequence, frame_length);
+ if(is_sequence) /* get sequence frame */
+ break;
+ }
+ start = sequence_offset;
+ }