]> git.sesse.net Git - vlc/blobdiff - modules/demux/stl.c
minimal_macosx: simplify killer thread loop
[vlc] / modules / demux / stl.c
index 9e401569d592261eb668a6cf79e57f2927d08bd3..8f04e514877f1d5ff4cbb5a52fd5ab6880c67b6d 100644 (file)
@@ -6,19 +6,19 @@
  *
  * Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
@@ -68,7 +68,7 @@ struct demux_sys_t {
     int64_t     next_date;
 };
 
-static int ParseInteger(uint8_t *data, int size)
+static int ParseInteger(uint8_t *data, size_t size)
 {
     char tmp[16];
     assert(size < sizeof(tmp));
@@ -173,13 +173,13 @@ static int Open(vlc_object_t *object)
     const int cct = ParseInteger(&header[12], 2);
     const mtime_t program_start = ParseTextTimeCode(&header[256], fps);
     const int tti_count = ParseInteger(&header[238], 5);
-    msg_Dbg(demux, "Detected EBU STL : CCT=%d TTI=%d start=%8.8s %lld", cct, tti_count, &header[256], program_start);
+    msg_Dbg(demux, "Detected EBU STL : CCT=%d TTI=%d start=%8.8s %"PRId64, cct, tti_count, &header[256], program_start);
 
-    demux_sys_t *sys = malloc(sizeof(*sys));
+    demux_sys_t *sys = xmalloc(sizeof(*sys));
     sys->next_date = 0;
     sys->current   = 0;
     sys->count     = 0;
-    sys->index     = calloc(tti_count, sizeof(*sys->index));
+    sys->index     = xcalloc(tti_count, sizeof(*sys->index));
 
 
     bool comment = false;
@@ -221,7 +221,7 @@ static int Open(vlc_object_t *object)
 
     sys->es = es_out_Add(demux->out, &fmt);
 
-    fmt.i_extra = NULL;
+    fmt.i_extra = 0;
     fmt.p_extra = NULL;
     es_format_Clean(&fmt);