summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-10-24 13:04:34 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-10-24 13:14:33 +0200
commit6ef5e292200b6824b666a6a876d344fe7e6a48b2 (patch)
tree79c7ba1c956938f574846474fb4568ce694a10e8 /ffmpeg.c
parent7ad34f445648b8f0e8e15d67ccd61ca4c9192cdf (diff)
parent88b32673db39440422a73ec3047d3326c96b4fb2 (diff)
Merge commit '88b32673db39440422a73ec3047d3326c96b4fb2'
* commit '88b32673db39440422a73ec3047d3326c96b4fb2': avconv: copy stream-level side data when streamcopying Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 0c78fd52f8..1fd0ecebac 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2622,6 +2622,26 @@ static int transcode_init(void)
av_reduce(&enc_ctx->time_base.num, &enc_ctx->time_base.den,
enc_ctx->time_base.num, enc_ctx->time_base.den, INT_MAX);
+ if (ist->st->nb_side_data) {
+ ost->st->side_data = av_realloc_array(NULL, ist->st->nb_side_data,
+ sizeof(*ist->st->side_data));
+ if (!ost->st->side_data)
+ return AVERROR(ENOMEM);
+
+ for (j = 0; j < ist->st->nb_side_data; j++) {
+ const AVPacketSideData *sd_src = &ist->st->side_data[j];
+ AVPacketSideData *sd_dst = &ost->st->side_data[j];
+
+ sd_dst->data = av_malloc(sd_src->size);
+ if (!sd_dst->data)
+ return AVERROR(ENOMEM);
+ memcpy(sd_dst->data, sd_src->data, sd_src->size);
+ sd_dst->size = sd_src->size;
+ sd_dst->type = sd_src->type;
+ ost->st->nb_side_data++;
+ }
+ }
+
ost->parser = av_parser_init(enc_ctx->codec_id);
switch (enc_ctx->codec_type) {