提交 78fa0b90 编写于 作者: M Mark Thompson

h264_metadata: Always add the SEI user data to the first access unit

This should be added even if the first access unit does not contain
parameter sets.
上级 69062d0f
......@@ -62,6 +62,7 @@ typedef struct H264MetadataContext {
int crop_bottom;
const char *sei_user_data;
int sei_first_au;
} H264MetadataContext;
......@@ -287,14 +288,17 @@ static int h264_metadata_filter(AVBSFContext *bsf, AVPacket *out)
}
}
// Only insert the SEI in access units containing SPSs.
if (has_sps && ctx->sei_user_data) {
// Only insert the SEI in access units containing SPSs, and also
// unconditionally in the first access unit we ever see.
if (ctx->sei_user_data && (has_sps || !ctx->sei_first_au)) {
H264RawSEIPayload payload = {
.payload_type = H264_SEI_TYPE_USER_DATA_UNREGISTERED,
};
H264RawSEIUserDataUnregistered *udu =
&payload.payload.user_data_unregistered;
ctx->sei_first_au = 1;
for (i = j = 0; j < 32 && ctx->sei_user_data[i]; i++) {
int c, v;
c = ctx->sei_user_data[i];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册