diff options
author | Martin Storsjo <martin@martin.st> | 2015-06-29 16:33:39 +0300 |
---|---|---|
committer | Marco Nelissen <marcone@google.com> | 2015-07-31 18:50:12 +0000 |
commit | 6fb90f8feccf128b2503f50b7369cbc12afe489e (patch) | |
tree | 2cf95299e8daeb9bd27796d5ef009c3f364cbf5d /encoder | |
parent | dc4c6140a935c949b888e5cb16a198444a24d031 (diff) | |
download | android_external_libavc-6fb90f8feccf128b2503f50b7369cbc12afe489e.tar.gz android_external_libavc-6fb90f8feccf128b2503f50b7369cbc12afe489e.tar.bz2 android_external_libavc-6fb90f8feccf128b2503f50b7369cbc12afe489e.zip |
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
Diffstat (limited to 'encoder')
-rw-r--r-- | encoder/ih264e_encode.c | 6 | ||||
-rw-r--r-- | encoder/ih264e_utils.c | 8 |
2 files changed, 12 insertions, 2 deletions
diff --git a/encoder/ih264e_encode.c b/encoder/ih264e_encode.c index 4697d73..e7057dc 100644 --- a/encoder/ih264e_encode.c +++ b/encoder/ih264e_encode.c @@ -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; /* 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 */ ps_video_encode_op->s_ive_op.output_present = 1; diff --git a/encoder/ih264e_utils.c b/encoder/ih264e_utils.c index 8623949..82a96d0 100644 --- a/encoder/ih264e_utils.c +++ b/encoder/ih264e_utils.c @@ -206,6 +206,7 @@ WORD32 ih264e_input_queue_update(codec_t *ps_codec, && !ps_codec->i4_last_inp_buff_received) { ps_enc_buff->s_raw_buf.apv_bufs[0] = NULL; + ps_enc_buff->u4_is_last = ps_ive_ip->u4_is_last; 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_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)) { ps_enc_buff->s_raw_buf.apv_bufs[0] = NULL; + ps_enc_buff->u4_is_last = 0; return 0; } |