dashdemux: Move code around to keep all sidx related functions together
authorSebastian Dröge <sebastian@centricular.com>
Thu, 7 Apr 2016 10:34:57 +0000 (13:34 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Thu, 11 Aug 2016 09:56:54 +0000 (11:56 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=741104

ext/dash/gstisoff.c

index da08d95..fafbc0f 100644 (file)
 
 #include <string.h>
 
-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)