summaryrefslogtreecommitdiff
path: root/gst-libs/gst
diff options
context:
space:
mode:
authorWind Yuan <feng.yuan@intel.com>2012-10-12 16:44:05 +0800
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-12-17 14:56:11 +0100
commite15c74acbf82be354fcec765028c5ae87f59b564 (patch)
treebd7256d788ff7058eb98528bfee45c1343035985 /gst-libs/gst
parent181e47fb25d5833a2d73df9fdf3e1707cee44db2 (diff)
mpeg4: fix size argument to gst_adapter_flush().
Flush only consumed_size bytes from the GstAdapter. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Diffstat (limited to 'gst-libs/gst')
-rw-r--r--gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c b/gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c
index f408cd63..012d4465 100644
--- a/gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c
+++ b/gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c
@@ -956,8 +956,8 @@ decode_buffer(GstVaapiDecoderMpeg4 *decoder, GstBuffer *buffer)
consumed_size = packet.offset + packet.size;
pos += consumed_size;
- if (gst_adapter_available(priv->adapter) >= pos)
- gst_adapter_flush(priv->adapter, pos);
+ if (gst_adapter_available(priv->adapter) >= consumed_size)
+ gst_adapter_flush(priv->adapter, consumed_size);
}
else {
GST_WARNING("decode h263 packet failed\n");
@@ -977,8 +977,8 @@ decode_buffer(GstVaapiDecoderMpeg4 *decoder, GstBuffer *buffer)
GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA == status) {
consumed_size = packet.offset + packet.size - pos;
pos = packet.offset + packet.size;
- if (gst_adapter_available(priv->adapter) >= pos)
- gst_adapter_flush(priv->adapter, pos);
+ if (gst_adapter_available(priv->adapter) >= consumed_size)
+ gst_adapter_flush(priv->adapter, consumed_size);
}
else {
GST_WARNING("decode mp4 packet failed\n");