summaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-12-17 13:20:37 +0100
committerHendrik Leppkes <h.leppkes@gmail.com>2015-12-17 13:20:37 +0100
commitbe52b95d311bb392fe99a6bb3b8db74e255043e3 (patch)
tree029e7d9893f9f0129953136cc81436ce83c4fa6f /ffmpeg.c
parenta7d5b9f1c3ca2e63b0eb882eabadfa1461d17a2d (diff)
parente63e3797a1ed9346f529848e6ba3d27fd2d2cc8d (diff)
downloadffmpeg-streaming-be52b95d311bb392fe99a6bb3b8db74e255043e3.zip
ffmpeg-streaming-be52b95d311bb392fe99a6bb3b8db74e255043e3.tar.gz
Merge commit 'e63e3797a1ed9346f529848e6ba3d27fd2d2cc8d'
* commit 'e63e3797a1ed9346f529848e6ba3d27fd2d2cc8d': avconv: pass the global codec side data to the muxer Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index a3c8922..10d0f25 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2656,6 +2656,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++;
+ }
+ }
+
// copy timebase while removing common factors
ost->st->time_base = av_add_q(ost->enc_ctx->time_base, (AVRational){0, 1});
ost->st->codec->codec= ost->enc_ctx->codec;
OpenPOWER on IntegriCloud