summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorhkuang <hkuang@google.com>2014-10-17 10:09:56 -0700
committerhkuang <hkuang@google.com>2014-10-17 10:09:56 -0700
commite3bf55dedbe9c95824f53a22a241166579e50dbe (patch)
treeb5ece5c66933bcb1c64e1bbcc5526e6eec3787f5 /vp9
parent00f1cf40ed90acd7e5a94ea7fc9c7b5e6fbc01a0 (diff)
downloadlibvpx-e3bf55dedbe9c95824f53a22a241166579e50dbe.tar
libvpx-e3bf55dedbe9c95824f53a22a241166579e50dbe.tar.gz
libvpx-e3bf55dedbe9c95824f53a22a241166579e50dbe.tar.bz2
libvpx-e3bf55dedbe9c95824f53a22a241166579e50dbe.zip
Correct the logic of ready_for_new_data.
This should be set right after decoder really start to decode frame instead setting at the end. Even decoder does not have a displayable frame to show and return NULL to application, this should be set too. Change-Id: If0313a834bc64e3b0f05a84f4459d444d9eab0d8
Diffstat (limited to 'vp9')
-rw-r--r--vp9/decoder/vp9_decoder.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/vp9/decoder/vp9_decoder.c b/vp9/decoder/vp9_decoder.c
index 3c9469c4c..baf6ab7ef 100644
--- a/vp9/decoder/vp9_decoder.c
+++ b/vp9/decoder/vp9_decoder.c
@@ -232,6 +232,8 @@ int vp9_receive_compressed_data(VP9Decoder *pbi,
cm->frame_refs[0].buf->corrupted = 1;
}
+ pbi->ready_for_new_data = 0;
+
// Check if the previous frame was a frame without any references to it.
if (cm->new_fb_idx >= 0 && cm->frame_bufs[cm->new_fb_idx].ref_count == 0)
cm->release_fb_cb(cm->cb_priv,
@@ -279,8 +281,6 @@ int vp9_receive_compressed_data(VP9Decoder *pbi,
cm->current_video_frame++;
}
- pbi->ready_for_new_data = 0;
-
cm->error.setjmp = 0;
return retcode;
}
@@ -296,12 +296,12 @@ int vp9_get_raw_frame(VP9Decoder *pbi, YV12_BUFFER_CONFIG *sd,
if (pbi->ready_for_new_data == 1)
return ret;
+ pbi->ready_for_new_data = 1;
+
/* no raw frame to show!!! */
if (!cm->show_frame)
return ret;
- pbi->ready_for_new_data = 1;
-
#if CONFIG_VP9_POSTPROC
if (!cm->show_existing_frame) {
ret = vp9_post_proc_frame(cm, sd, flags);