+
+ if (wants_global_headers) {
+ x264_nal_t *nal;
+ int num_nal;
+
+ x264_encoder_headers(x264, &nal, &num_nal);
+
+ for (int i = 0; i < num_nal; ++i) {
+ if (nal[i].i_type == NAL_SEI) {
+ // Don't put the SEI in extradata; make it part of the first frame instead.
+ buffered_sei += string((const char *)nal[i].p_payload, nal[i].i_payload);
+ } else {
+ global_headers += string((const char *)nal[i].p_payload, nal[i].i_payload);
+ }
+ }
+ }