changeset 11043:916df4ea4e64 libavcodec

Initialize thread_context[0] with h264 parser context. This allows freeing the parser memory in the thread_context freeing loop. Patch by Rafa¸«³l Carr¸«± gmailify(rafael, carre)
author benoit
date Thu, 28 Jan 2010 13:04:25 +0000
parents 74f672a1f763
children 3f66d1d80e03
files h264_parser.c
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/h264_parser.c	Thu Jan 28 11:37:35 2010 +0000
+++ b/h264_parser.c	Thu Jan 28 13:04:25 2010 +0000
@@ -309,11 +309,17 @@
     ff_h264_free_context(h);
 }
 
+static int init(AVCodecParserContext *s)
+{
+    H264Context *h = s->priv_data;
+    h->thread_context[0] = h;
+    return 0;
+}
 
 AVCodecParser h264_parser = {
     { CODEC_ID_H264 },
     sizeof(H264Context),
-    NULL,
+    init,
     h264_parse,
     close,
     h264_split,