summaryrefslogtreecommitdiff
path: root/avconv.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2014-10-18 18:19:55 +0200
committerAnton Khirnov <anton@khirnov.net>2014-10-24 09:03:16 +0200
commit88b32673db39440422a73ec3047d3326c96b4fb2 (patch)
tree2d6ca4196ec5a6f09a5ce49798266fc22773158b /avconv.c
parentc63418e0a3afbcdbc59fd65c270d45efafe092ce (diff)
avconv: copy stream-level side data when streamcopying
Diffstat (limited to 'avconv.c')
-rw-r--r--avconv.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/avconv.c b/avconv.c
index 23f69cb517..8e76863bec 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1753,6 +1753,26 @@ static int transcode_init(void)
} else
enc_ctx->time_base = ist->st->time_base;
+ 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) {