1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

copy extradata if present

Originally committed as revision 13913 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Baptiste Coudurier 2008-06-23 19:57:58 +00:00
parent a33a6eb2ce
commit cb51aef1ab

View File

@ -2497,9 +2497,18 @@ static int http_receive_data(HTTPContext *c)
goto fail;
}
for (i = 0; i < s->nb_streams; i++)
memcpy(feed->streams[i]->codec,
s->streams[i]->codec, sizeof(AVCodecContext));
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);
}
}
av_close_input_stream(s);
av_free(pb);