In some previous versions I used to reject packets with transport_error_indicator set. The latest version ignores it.
For frame detection:
Wait for a picture coding extension and then:
Code:
if (picture_structure == 3 ||
(top_field_first && picture_structure == 1) ||
(!top_field_first && picture_structure == 2))
{
// New frame.
}
Note that the frame lines in the index file are sorted into display order per sequence before being printed to the DGM file. To do that I have to accumulate a full sequence before outputing it.