From 5634f30c4a25c17c1de26703948efeafb733413d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin@martin.st>
Date: Tue, 22 Jun 2010 06:45:05 +0000
Subject: [PATCH] ffserver: Use avcodec_copy_context instead of manually
 copying an AVCodecContext

Originally committed as revision 23692 to svn://svn.ffmpeg.org/ffmpeg/trunk
---
 ffserver.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 31d0268d05c..14141f7ab21 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2748,14 +2748,7 @@ static int http_receive_data(HTTPContext *c)
             for (i = 0; i < s->nb_streams; i++) {
                 AVStream *fst = feed->streams[i];
                 AVStream *st = s->streams[i];
-                memcpy(fst->codec, st->codec, sizeof(AVCodecContext));
-                if (fst->codec->extradata_size) {
-                    fst->codec->extradata = av_malloc(fst->codec->extradata_size);
-                    if (!fst->codec->extradata)
-                        goto fail;
-                    memcpy(fst->codec->extradata, st->codec->extradata,
-                           fst->codec->extradata_size);
-                }
+                avcodec_copy_context(fst->codec, st->codec);
             }
 
             av_close_input_stream(s);
-- 
GitLab