aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2015-10-04 13:17:41 +0200
committerAnton Khirnov <anton@khirnov.net>2015-12-06 10:23:21 +0100
commite63e3797a1ed9346f529848e6ba3d27fd2d2cc8d (patch)
tree37f9874b716ed6d8bab9b736b029874d0c7663e1
parent84adab333cddeefc3cfd843089dee23f58bd372c (diff)
downloadffmpeg-e63e3797a1ed9346f529848e6ba3d27fd2d2cc8d.tar.gz
avconv: pass the global codec side data to the muxer
-rw-r--r--avconv.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/avconv.c b/avconv.c
index 7334851530..57a371835d 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1602,6 +1602,28 @@ static int init_output_stream(OutputStream *ost, char *error, int error_len)
exit_program(1);
}
+ if (ost->enc_ctx->nb_coded_side_data) {
+ int i;
+
+ ost->st->side_data = av_realloc_array(NULL, ost->enc_ctx->nb_coded_side_data,
+ sizeof(*ost->st->side_data));
+ if (!ost->st->side_data)
+ return AVERROR(ENOMEM);
+
+ for (i = 0; i < ost->enc_ctx->nb_coded_side_data; i++) {
+ const AVPacketSideData *sd_src = &ost->enc_ctx->coded_side_data[i];
+ AVPacketSideData *sd_dst = &ost->st->side_data[i];
+
+ 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->st->time_base = ost->enc_ctx->time_base;
} else {
ret = av_opt_set_dict(ost->enc_ctx, &ost->encoder_opts);