diff --git a/ext/dash/gstisoff.c b/ext/dash/gstisoff.c index da08d95111..fafbc0fd2a 100644 --- a/ext/dash/gstisoff.c +++ b/ext/dash/gstisoff.c @@ -27,36 +27,6 @@ #include -void -gst_isoff_sidx_parser_init (GstSidxParser * parser) -{ - parser->status = GST_ISOFF_SIDX_PARSER_INIT; - parser->cumulative_entry_size = 0; - parser->sidx.entries = NULL; - parser->sidx.entries_count = 0; -} - -void -gst_isoff_sidx_parser_clear (GstSidxParser * parser) -{ - g_free (parser->sidx.entries); - parser->sidx.entries = NULL; -} - -static void -gst_isoff_parse_sidx_entry (GstSidxBoxEntry * entry, GstByteReader * reader) -{ - guint32 aux; - - aux = gst_byte_reader_get_uint32_be_unchecked (reader); - entry->ref_type = aux >> 31; - entry->size = aux & 0x7FFFFFFF; - entry->duration = gst_byte_reader_get_uint32_be_unchecked (reader); - aux = gst_byte_reader_get_uint32_be_unchecked (reader); - entry->starts_with_sap = aux >> 31; - entry->sap_type = ((aux >> 28) & 0x7); - entry->sap_delta_time = aux & 0xFFFFFFF; -} /* gst_isoff_parse_box: * @reader: @@ -112,6 +82,37 @@ not_enough_data: return FALSE; } +void +gst_isoff_sidx_parser_init (GstSidxParser * parser) +{ + parser->status = GST_ISOFF_SIDX_PARSER_INIT; + parser->cumulative_entry_size = 0; + parser->sidx.entries = NULL; + parser->sidx.entries_count = 0; +} + +void +gst_isoff_sidx_parser_clear (GstSidxParser * parser) +{ + g_free (parser->sidx.entries); + parser->sidx.entries = NULL; +} + +static void +gst_isoff_parse_sidx_entry (GstSidxBoxEntry * entry, GstByteReader * reader) +{ + guint32 aux; + + aux = gst_byte_reader_get_uint32_be_unchecked (reader); + entry->ref_type = aux >> 31; + entry->size = aux & 0x7FFFFFFF; + entry->duration = gst_byte_reader_get_uint32_be_unchecked (reader); + aux = gst_byte_reader_get_uint32_be_unchecked (reader); + entry->starts_with_sap = aux >> 31; + entry->sap_type = ((aux >> 28) & 0x7); + entry->sap_delta_time = aux & 0xFFFFFFF; +} + GstIsoffParserResult gst_isoff_sidx_parser_add_buffer (GstSidxParser * parser, GstBuffer * buffer, guint * consumed)