mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-06-20 14:16:17 +08:00
ffserver: Use avcodec_copy_context instead of manually copying an AVCodecContext
Originally committed as revision 23692 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
@ -2748,14 +2748,7 @@ static int http_receive_data(HTTPContext *c)
|
|||||||
for (i = 0; i < s->nb_streams; i++) {
|
for (i = 0; i < s->nb_streams; i++) {
|
||||||
AVStream *fst = feed->streams[i];
|
AVStream *fst = feed->streams[i];
|
||||||
AVStream *st = s->streams[i];
|
AVStream *st = s->streams[i];
|
||||||
memcpy(fst->codec, st->codec, sizeof(AVCodecContext));
|
avcodec_copy_context(fst->codec, st->codec);
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
av_close_input_stream(s);
|
av_close_input_stream(s);
|
||||||
|
Reference in New Issue
Block a user