diff --git a/host_applications/linux/apps/raspicam/RaspiStill.c b/host_applications/linux/apps/raspicam/RaspiStill.c index b4c483dc3..c7d3f7904 100644 --- a/host_applications/linux/apps/raspicam/RaspiStill.c +++ b/host_applications/linux/apps/raspicam/RaspiStill.c @@ -1277,7 +1277,7 @@ static MMAL_STATUS_T create_encoder_component(RASPISTILL_STATE *state) // Set the JPEG restart interval status = mmal_port_parameter_set_uint32(encoder_output, MMAL_PARAMETER_JPEG_RESTART_INTERVAL, state->restart_interval); - if (status != MMAL_SUCCESS) + if (state->restart_interval && status != MMAL_SUCCESS) { vcos_log_error("Unable to set JPEG restart interval"); goto error; diff --git a/host_applications/linux/apps/raspicam/RaspiVid.c b/host_applications/linux/apps/raspicam/RaspiVid.c index d3b077097..807e07ae2 100755 --- a/host_applications/linux/apps/raspicam/RaspiVid.c +++ b/host_applications/linux/apps/raspicam/RaspiVid.c @@ -1193,20 +1193,37 @@ static void encoder_buffer_callback(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buf if (pData->pstate->segmentWrap && pData->pstate->segmentNumber > pData->pstate->segmentWrap) pData->pstate->segmentNumber = 1; - new_handle = open_filename(pData->pstate, pData->pstate->filename); - - if (new_handle) + if (pData->pstate->filename && pData->pstate->filename[0] != '-') { - fclose(pData->file_handle); - pData->file_handle = new_handle; + new_handle = open_filename(pData->pstate, pData->pstate->filename); + + if (new_handle) + { + fclose(pData->file_handle); + pData->file_handle = new_handle; + } } - new_handle = open_filename(pData->pstate, pData->pstate->imv_filename); + if (pData->pstate->imv_filename && pData->pstate->imv_filename[0] != '-') + { + new_handle = open_filename(pData->pstate, pData->pstate->imv_filename); + + if (new_handle) + { + fclose(pData->imv_file_handle); + pData->imv_file_handle = new_handle; + } + } - if (new_handle) + if (pData->pstate->pts_filename && pData->pstate->pts_filename[0] != '-') { - fclose(pData->imv_file_handle); - pData->imv_file_handle = new_handle; + new_handle = open_filename(pData->pstate, pData->pstate->pts_filename); + + if (new_handle) + { + fclose(pData->pts_file_handle); + pData->pts_file_handle = new_handle; + } } } if (buffer->length)