diff options
author | Harish Mahendrakar <harish.mahendrakar@ittiam.com> | 2015-09-02 09:01:40 +0530 |
---|---|---|
committer | Harish Mahendrakar <harish.mahendrakar@ittiam.com> | 2015-09-02 16:51:43 +0530 |
commit | 39f8ae0a351fc41fe87de30c989b6a6d649634ae (patch) | |
tree | 82a2af5058eafad7564084639d3acddc684fa134 /test | |
parent | fe2bfd392c7d7092ed5fddb93974787e95f93326 (diff) | |
download | android_external_libavc-39f8ae0a351fc41fe87de30c989b6a6d649634ae.tar.gz android_external_libavc-39f8ae0a351fc41fe87de30c989b6a6d649634ae.tar.bz2 android_external_libavc-39f8ae0a351fc41fe87de30c989b6a6d649634ae.zip |
Decoder: Fixed an issue in handling flush
Fixed a NULL pointer reference, when flush is called before
decoding any pictures.
This was seen in following CTS test,
android.media.cts.DecoderTest#testCodecResetsH264WithSurface
Fixed code formatting issues in ih264d_set_flush_mode
Updated the testbench to call flush before decoding starts
Change-Id: Ib04e0b15573b2482c9d5b43c8bc7dd30d8f8efdd
Diffstat (limited to 'test')
-rw-r--r-- | test/decoder/main.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/test/decoder/main.c b/test/decoder/main.c index 89a54c5..875ed3d 100644 --- a/test/decoder/main.c +++ b/test/decoder/main.c @@ -65,8 +65,8 @@ #endif //#define ADAPTIVE_TEST -#define ADAPTIVE_MAX_WD 1920 -#define ADAPTIVE_MAX_HT 1088 +#define ADAPTIVE_MAX_WD 4096 +#define ADAPTIVE_MAX_HT 2160 #define ALIGN8(x) ((((x) + 7) >> 3) << 3) #define NUM_DISPLAY_BUFFERS 4 @@ -1789,7 +1789,7 @@ int main(WORD32 argc, CHAR *argv[]) WORD32 ret; CHAR ac_error_str[STRLENGTH]; vid_dec_ctx_t s_app_ctx; - UWORD8 *pu1_bs_buf; + UWORD8 *pu1_bs_buf = NULL; ivd_out_bufdesc_t *ps_out_buf; UWORD32 u4_num_bytes_dec = 0; @@ -2228,6 +2228,10 @@ int main(WORD32 argc, CHAR *argv[]) } + flush_output(codec_obj, &s_app_ctx, ps_out_buf, + pu1_bs_buf, &u4_op_frm_ts, + ps_op_file, ps_op_chksum_file, + u4_ip_frm_ts, u4_bytes_remaining); /*****************************************************************************/ /* Decode header to get width and height and buffer sizes */ @@ -2334,8 +2338,6 @@ int main(WORD32 argc, CHAR *argv[]) s_app_ctx.u4_pic_wd = s_video_decode_op.u4_pic_wd; s_app_ctx.u4_pic_ht = s_video_decode_op.u4_pic_ht; - /* Allocate input buffer */ - u4_ip_buf_len = 2048 * 2048; free(pu1_bs_buf); #if IOS_DISPLAY @@ -3139,5 +3141,8 @@ int main(WORD32 argc, CHAR *argv[]) free(ps_out_buf); free(pu1_bs_buf); + if(s_app_ctx.display_thread_handle) + free(s_app_ctx.display_thread_handle); + return (0); } |