Commit ab84effd authored by Michael Niedermayer's avatar Michael Niedermayer

ffmpeg: Copy extradata if it has been initialized later from the encoder

Fixes Ticket3909
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 033a5334
......@@ -590,6 +590,14 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
AVCodecContext *avctx = ost->st->codec;
int ret;
if (!ost->st->codec->extradata_size && ost->enc_ctx->extradata_size) {
ost->st->codec->extradata = av_mallocz(ost->enc_ctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
if (ost->st->codec->extradata) {
memcpy(ost->st->codec->extradata, ost->enc_ctx->extradata, ost->enc_ctx->extradata_size);
ost->st->codec->extradata_size = ost->enc_ctx->extradata_size;
}
}
if ((avctx->codec_type == AVMEDIA_TYPE_VIDEO && video_sync_method == VSYNC_DROP) ||
(avctx->codec_type == AVMEDIA_TYPE_AUDIO && audio_sync_method < 0))
pkt->pts = pkt->dts = AV_NOPTS_VALUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment