rpicamsrc: Clear intra-refresh MMAL param struct.

Use memset on the stack allocated MMAL_PARAMETER_VIDEO_INTRA_REFRESH_T
struct. Apparently mmal_port_parameter_get() doesn't retrieve all
parameters, causing random failures when we set the intra-refresh
param on the encoder.

Fixes https://github.com/thaytan/gst-rpicamsrc/issues/22 for me.
This commit is contained in:
Jan Schmidt 2015-04-21 02:45:59 +10:00 committed by Tim-Philipp Müller
parent 4d70e1d8ee
commit 3771777f7f

View file

@ -1441,6 +1441,13 @@ static MMAL_STATUS_T create_encoder_component(RASPIVID_STATE *state)
if (config->intra_refresh_type != -1)
{
MMAL_PARAMETER_VIDEO_INTRA_REFRESH_T param;
/* Need to memset, apparently mmal_port_parameter_get()
* doesn't retrieve all parameters, causing random failures
* when we set it
*/
memset (&param, 0, sizeof (MMAL_PARAMETER_VIDEO_INTRA_REFRESH_T));
param.hdr.id = MMAL_PARAMETER_VIDEO_INTRA_REFRESH;
param.hdr.size = sizeof(param);