diff -r -u -X diff.exclude release.19345.1212a/mythtv/libs/libmythtv/mpeg/mpegstreamdata.cpp release.19345.1212b/mythtv/libs/libmythtv/mpeg/mpegstreamdata.cpp
|
|
|
932 | 932 | { |
933 | 933 | if (buffer[pos] != SYNC_BYTE || resync) |
934 | 934 | { |
935 | | int newpos = ResyncStream(buffer, pos, len); |
| 935 | int newpos = ResyncStream(buffer, pos, len, resync); |
936 | 936 | if (newpos == -1) |
937 | 937 | return len - pos; |
938 | 938 | if (newpos == -2) |
… |
… |
|
999 | 999 | return true; |
1000 | 1000 | } |
1001 | 1001 | |
1002 | | int MPEGStreamData::ResyncStream(unsigned char *buffer, int curr_pos, int len) |
| 1002 | int MPEGStreamData::ResyncStream(unsigned char *buffer, int curr_pos, int len, bool force) |
1003 | 1003 | { |
1004 | 1004 | // Search for two sync bytes 188 bytes apart, |
1005 | 1005 | int pos = curr_pos; |
1006 | 1006 | int nextpos = pos + TSPacket::SIZE; |
| 1007 | if (force) // The sync bytes might match but the packet processing failed |
| 1008 | { |
| 1009 | pos++; |
| 1010 | nextpos++; |
| 1011 | } |
1007 | 1012 | if (nextpos >= len) |
1008 | 1013 | return -1; // not enough bytes; caller should try again |
1009 | 1014 | |
diff -r -u -X diff.exclude release.19345.1212a/mythtv/libs/libmythtv/mpeg/mpegstreamdata.h release.19345.1212b/mythtv/libs/libmythtv/mpeg/mpegstreamdata.h
|
|
|
293 | 293 | void ProcessPMT(const ProgramMapTable *pmt); |
294 | 294 | void ProcessEncryptedPacket(const TSPacket&); |
295 | 295 | |
296 | | static int ResyncStream(unsigned char *buffer, int curr_pos, int len); |
| 296 | static int ResyncStream(unsigned char *buffer, int curr_pos, int len, bool force); |
297 | 297 | |
298 | 298 | void UpdateTimeOffset(uint64_t si_utc_time); |
299 | 299 | |