Make sure that apv_bufs[0] and u4_is_last always are set
When encoding in header mode, the s_inp_buf struct that was written to ps_video_encode_op->s_ive_op.s_inp_buf was completely uninitialized. In ih264e_input_queue_update, make sure to initialize u4_is_last when skipping frames. Bug: 22860270 Change-Id: I87e677acd00baf4f732ca7d35ee192e7f1f73994
This commit is contained in:
parent
dc4c6140a9
commit
6fb90f8fec
2 changed files with 12 additions and 2 deletions
|
|
@ -361,7 +361,11 @@ WORD32 ih264e_encode(iv_obj_t *ps_codec_obj, void *pv_api_ip, void *pv_api_op)
|
||||||
ps_codec->i4_gen_header = 0;
|
ps_codec->i4_gen_header = 0;
|
||||||
|
|
||||||
/* send the input to app */
|
/* send the input to app */
|
||||||
ps_video_encode_op->s_ive_op.s_inp_buf = s_inp_buf.s_raw_buf;
|
ps_video_encode_op->s_ive_op.s_inp_buf = ps_video_encode_ip->s_ive_ip.s_inp_buf;
|
||||||
|
ps_video_encode_op->s_ive_op.u4_timestamp_low = ps_video_encode_ip->s_ive_ip.u4_timestamp_low;
|
||||||
|
ps_video_encode_op->s_ive_op.u4_timestamp_high = ps_video_encode_ip->s_ive_ip.u4_timestamp_high;
|
||||||
|
|
||||||
|
ps_video_encode_op->s_ive_op.u4_is_last = ps_video_encode_ip->s_ive_ip.u4_is_last;
|
||||||
|
|
||||||
/* send the output to app */
|
/* send the output to app */
|
||||||
ps_video_encode_op->s_ive_op.output_present = 1;
|
ps_video_encode_op->s_ive_op.output_present = 1;
|
||||||
|
|
|
||||||
|
|
@ -206,6 +206,7 @@ WORD32 ih264e_input_queue_update(codec_t *ps_codec,
|
||||||
&& !ps_codec->i4_last_inp_buff_received)
|
&& !ps_codec->i4_last_inp_buff_received)
|
||||||
{
|
{
|
||||||
ps_enc_buff->s_raw_buf.apv_bufs[0] = NULL;
|
ps_enc_buff->s_raw_buf.apv_bufs[0] = NULL;
|
||||||
|
ps_enc_buff->u4_is_last = ps_ive_ip->u4_is_last;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -223,7 +224,11 @@ WORD32 ih264e_input_queue_update(codec_t *ps_codec,
|
||||||
ps_codec->s_rate_control.pps_time_stamp,
|
ps_codec->s_rate_control.pps_time_stamp,
|
||||||
ps_codec->s_rate_control.pps_frame_time);
|
ps_codec->s_rate_control.pps_frame_time);
|
||||||
|
|
||||||
if (skip_src) return 1;
|
if (skip_src)
|
||||||
|
{
|
||||||
|
ps_enc_buff->u4_is_last = ps_ive_ip->u4_is_last;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
|
|
@ -278,6 +283,7 @@ WORD32 ih264e_input_queue_update(codec_t *ps_codec,
|
||||||
< (WORD32)(ps_codec->s_cfg.u4_num_bframes))
|
< (WORD32)(ps_codec->s_cfg.u4_num_bframes))
|
||||||
{
|
{
|
||||||
ps_enc_buff->s_raw_buf.apv_bufs[0] = NULL;
|
ps_enc_buff->s_raw_buf.apv_bufs[0] = NULL;
|
||||||
|
ps_enc_buff->u4_is_last = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue