// Return TRUE if all was read. FALSE if a problem occured: // If a bitstream syntax problem occured the bitstream will // point to after the problem, in case we run out of data the bitstream // will point to where we want to restart after getting more. static int read_gop_info(struct bitstream *esstream) { dbg_print(DMT_VERBOSE, "Read GOP Info\n"); // We only get here after seeing that start code if (next_u32(esstream) != 0xB8010000) // LSB first (0x000001B8) fatal(EXIT_BUG_BUG, "Impossible!"); // If we get here esstream points to the start of a group_start_code // should we run out of data in esstream this is where we want to restart // after getting more. unsigned char *gop_info_start = esstream->pos; gop_header(esstream); //extension_and_user_data(esstream); if (esstream->error) return 0; if (esstream->bitsleft < 0) { init_bitstream(esstream, gop_info_start, esstream->end); return 0; } dbg_print(DMT_VERBOSE, "Read GOP Info - processed\n\n"); return 1; }
// Return TRUE if all was read. FALSE if a problem occured: // If a bitstream syntax problem occured the bitstream will // point to after the problem, in case we run out of data the bitstream // will point to where we want to restart after getting more. static int read_gop_info(struct lib_cc_decode *ctx, struct bitstream *esstream, struct cc_subtitle *sub) { debug("Read GOP Info\n"); // We only get here after seeing that start code if (next_u32(esstream) != 0xB8010000) // LSB first (0x000001B8) fatal(CCX_COMMON_EXIT_BUG_BUG, "read_gop_info: next_u32(esstream) != 0xB8010000. Please file a bug report in GitHub.\n"); // If we get here esstream points to the start of a group_start_code // should we run out of data in esstream this is where we want to restart // after getting more. unsigned char *gop_info_start = esstream->pos; gop_header(ctx, esstream, sub); //extension_and_user_data(esstream); if (esstream->error) return 0; if (esstream->bitsleft < 0) { init_bitstream(esstream, gop_info_start, esstream->end); return 0; } debug("Read GOP Info - processed\n\n"); return 1; }