diff --git a/ext/libav/gstavviddec.c b/ext/libav/gstavviddec.c index 4689d57d98..83df91774a 100644 --- a/ext/libav/gstavviddec.c +++ b/ext/libav/gstavviddec.c @@ -1540,18 +1540,18 @@ gst_ffmpegviddec_handle_frame (GstVideoDecoder * decoder, len = 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) { GST_LOG_OBJECT (ffmpegdec, "breaking because of flow ret %s", 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; break; } + if (do_padding) { + memcpy (data + size, tmp_padding, FF_INPUT_BUFFER_PADDING_SIZE); + } + if (len == 0 && have_data == 0) { /* nothing was decoded, this could be because no data was available or * because we were skipping frames.