Commit a8d53862 authored by mru's avatar mru

place SPS/PPS in extradata if GLOBAL_HEADER flag is set


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@4872 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 0355eb4e
......@@ -247,12 +247,30 @@ X264_init(AVCodecContext *avctx)
x4->params.i_threads = avctx->thread_count;
if(avctx->flags & CODEC_FLAG_GLOBAL_HEADER){
x4->params.b_repeat_headers = 0;
}
x4->enc = x264_encoder_open(&x4->params);
if(!x4->enc)
return -1;
avctx->coded_frame = &x4->out_pic;
if(avctx->flags & CODEC_FLAG_GLOBAL_HEADER){
x264_nal_t *nal;
int nnal, i, s = 0;
x264_encoder_headers(x4->enc, &nal, &nnal);
/* 5 bytes NAL header + worst case escaping */
for(i = 0; i < nnal; i++)
s += 5 + nal[i].i_payload * 4 / 3;
avctx->extradata = av_malloc(s);
avctx->extradata_size = encode_nals(avctx->extradata, s, nal, nnal);
}
return 0;
}
......
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