summaryrefslogtreecommitdiff
path: root/libavcodec/h264_parser.c
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-01-28 13:04:25 +0000
committerBenoit Fouet <benoit.fouet@free.fr>2010-01-28 13:04:25 +0000
commite9ca315dd188c38621c9439ef813d1cdf846ce1d (patch)
treee5a3a6c71bd4d0beb44f6e77ba2945340e11305d /libavcodec/h264_parser.c
parent592e03a8da7c0f396c19f71b051f6950f1b640fe (diff)
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) Originally committed as revision 21508 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264_parser.c')
-rw-r--r--libavcodec/h264_parser.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index dabd475f93..d9af8c9c36 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -309,11 +309,17 @@ static void close(AVCodecParserContext *s)
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,