Skip to content

Commit

Permalink
rpicamsrc: Clear intra-refresh MMAL param struct.
Browse files Browse the repository at this point in the history
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 thaytan/gst-rpicamsrc#22 for me.
  • Loading branch information
thaytan authored and havardgraff committed Jul 15, 2020
1 parent 70a5535 commit 319e1b6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sys/rpicamsrc/RaspiCapture.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 319e1b6

Please sign in to comment.