Permalink
Browse files

CEA-708: Fix spontaneous resets. Closes #9577

Signed-off-by: Mark Kendall <mkendall@mythtv.org>
  • Loading branch information...
1 parent 38f2f4f commit eebd67a1db7d6f30334b4aba908f6d9ee859882b @argilo argilo committed with Mark Kendall Mar 28, 2011
Showing with 39 additions and 4 deletions.
  1. +39 −4 mythtv/libs/libmythtv/cc708decoder.cpp
@@ -123,10 +123,45 @@ static void parse_cc_service_stream(CC708Reader* cc, uint service_num)
// find last reset or delay cancel in buffer
for (i = 0; i < blk_size; i++)
{
- if (RST == cc->buf[service_num][i])
- rst_loc = dlc_loc = i;
- else if (DLC == cc->buf[service_num][i])
- dlc_loc = i;
+ switch (cc->buf[service_num][i]) {
+ // Skip over parameters, since their bytes may coincide
+ // with RST or DLC
+ case CLW:
+ case DLW:
+ case DSW:
+ case HDW:
+ case TGW:
+ case DLY:
+ i += 1;
+ break;
+ case SPA:
+ case SPL:
+ i += 2;
+ break;
+ case SPC:
+ i += 3;
+ break;
+ case SWA:
+ i += 4;
+ break;
+ case DF0:
+ case DF1:
+ case DF2:
+ case DF3:
+ case DF4:
+ case DF5:
+ case DF6:
+ case DF7:
+ i += 6;
+ break;
+ // Detect RST or DLC bytes
+ case RST:
+ rst_loc = dlc_loc = i;
+ break;
+ case DLC:
+ dlc_loc = i;
+ break;
+ }
}
// reset, process only data after reset

0 comments on commit eebd67a

Please sign in to comment.