On 31.10.2014 02:14, Sevan Gelici wrote:
Hi,
Two days ago i updated my linux system and also ffmpeg was updated. When i
started to stream it was not working anymore. I am using ffserver. i
determined the problem which causes the problem thats the bitrate it makes
like 50mb of it. i reinstalled the system a couple times because of some
tests and still i don't get it work. Can someone help me with this pls.
I fixed it on 2.3 release branch. I know this should be done on master
first, but I wanted to be close for the commit that introduced the problem.
There are some changes in later releases so cherry-pick would not be
enough tho, to fix it on previous release
Fix patches attached.
>From 9c1455bd9e830aedba645451b7c0cb44831658e2 Mon Sep 17 00:00:00 2001
From: Lukasz Marek <lukasz.m.lu...@gmail.com>
Date: Wed, 5 Nov 2014 02:10:24 +0100
Subject: [PATCH 1/2] lavc/options: don't free options while they are still in
use
Signed-off-by: Lukasz Marek <lukasz.m.lu...@gmail.com>
---
libavcodec/options.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/libavcodec/options.c b/libavcodec/options.c
index 64b27e5..a13f3e3 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -181,8 +181,6 @@ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
return AVERROR(EINVAL);
}
- av_opt_free(dest);
-
memcpy(dest, src, sizeof(*dest));
dest->priv_data = orig_priv_data;
--
1.9.1
>From 3425953e04113a37a6b54217bc2254a76405e7f7 Mon Sep 17 00:00:00 2001
From: Lukasz Marek <lukasz.m.lu...@gmail.com>
Date: Wed, 5 Nov 2014 01:58:59 +0100
Subject: [PATCH 2/2] ffmpeg_opt: set correct priv_data for feed stream
new_output_stream creates a codec context with arbitraty picked codec.
Later data is updated, but priv_data are left alone.
There is a bit chance there is a mismatch between codecs.
Signed-off-by: Lukasz Marek <lukasz.m.lu...@gmail.com>
---
ffmpeg_opt.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index a825062..97056e8 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -1636,6 +1636,10 @@ static int read_ffserver_streams(OptionsContext *o, AVFormatContext *s, const ch
memcpy(st->info, ic->streams[i]->info, sizeof(*st->info));
st->codec= avctx;
avcodec_copy_context(st->codec, ic->streams[i]->codec);
+ av_opt_free(st->codec);
+ av_free(st->codec->priv_data);
+ st->codec->priv_data = ic->streams[i]->codec->priv_data;
+ ic->streams[i]->codec->priv_data = NULL;
if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && !ost->stream_copy)
choose_sample_fmt(st, codec);
--
1.9.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel