]> git.sesse.net Git - x264/blobdiff - matroska.c
fix a race condition at the end of thread_input
[x264] / matroska.c
index 430f51684e9c515235744f608fc3ab54eeac132d..35ae4cdb4a5bd4aa4523c010489ce765ab8dfa52 100644 (file)
@@ -1,10 +1,7 @@
 /*****************************************************************************
  * matroska.c:
  *****************************************************************************
- * Copyright (C) 2005 x264 project
- * $Id: $
- *
- * Authors: Mike Matsnev
+ * Copyright (C) 2005 Mike Matsnev
  *
  * 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
  *
  * 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., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111, USA.
  *****************************************************************************/
 
-#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#else
-#include <inttypes.h>
-#endif
-
+#include "common/osdep.h"
 #include "matroska.h"
 
 #define        CLSIZE    1048576
@@ -86,6 +76,7 @@ static mk_Context *mk_createContext(mk_Writer *w, mk_Context *parent, unsigned i
     c->owner->actlist->prev = &c->next;
   c->next = c->owner->actlist;
   c->prev = &c->owner->actlist;
+  c->owner->actlist = c;
 
   return c;
 }
@@ -416,7 +407,7 @@ static int mk_closeCluster(mk_Writer *w) {
   return 0;
 }
 
-int      mk_flushFrame(mk_Writer *w) {
+static int mk_flushFrame(mk_Writer *w) {
   int64_t      delta, ref = 0;
   unsigned     fsize, bgsize;
   unsigned char        c_delta_flags[3];