avviddec: Don't copy padding if handling a frame failed

We will return an error right afterwards anyway.
This commit is contained in:
Sebastian Dröge 2015-03-09 22:02:38 +01:00
parent 099ea5f2d1
commit 4459d706c8

View file

@ -1540,18 +1540,18 @@ gst_ffmpegviddec_handle_frame (GstVideoDecoder * decoder,
len = len =
gst_ffmpegviddec_frame (ffmpegdec, data, size, &have_data, frame, &ret); gst_ffmpegviddec_frame (ffmpegdec, data, size, &have_data, frame, &ret);
if (do_padding) {
memcpy (data + size, tmp_padding, FF_INPUT_BUFFER_PADDING_SIZE);
}
if (ret != GST_FLOW_OK) { if (ret != GST_FLOW_OK) {
GST_LOG_OBJECT (ffmpegdec, "breaking because of flow ret %s", GST_LOG_OBJECT (ffmpegdec, "breaking because of flow ret %s",
gst_flow_get_name (ret)); gst_flow_get_name (ret));
/* bad flow retun, make sure we discard all data and exit */ /* bad flow return, make sure we discard all data and exit */
bsize = 0; bsize = 0;
break; break;
} }
if (do_padding) {
memcpy (data + size, tmp_padding, FF_INPUT_BUFFER_PADDING_SIZE);
}
if (len == 0 && have_data == 0) { if (len == 0 && have_data == 0) {
/* nothing was decoded, this could be because no data was available or /* nothing was decoded, this could be because no data was available or
* because we were skipping frames. * because we were skipping frames.