<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _update_recording(self, frame, config):
    '''Adds a frame to the current video output.'''
    # pylint: disable=redefined-variable-type
    should_record = config['is_recording']

    if should_record:
      if not self.is_recording:
        self.is_recording = True
        logger.info(
            'Starting recording using %s',
            self.video_writer.current_output().name())
      self.video_writer.write_frame(frame)
    elif self.is_recording:
      self.is_recording = False
      self.video_writer.finish()
      logger.info('Finished recording')