Index: video2.c =================================================================== --- video2.c (revisión: 173) +++ video2.c (copia de trabajo) @@ -789,20 +789,19 @@ #ifdef HAVE_FFMPEG case V4L2_PIX_FMT_MJPEG: { - netcam_buff temp_netcam_buff = *the_buffer; - - temp_netcam_buff.ptr = - (char *) MJPEGDecodeFrame((unsigned char *) the_buffer->ptr, - the_buffer->content_length, cnt->imgs.common_buffer, - (width * height << 1), s->mjpeg); + FILE *fileout=NULL; + fileout = fopen("/tmp/MJPEG-dump.motion","w"); - if (temp_netcam_buff.ptr == NULL){ - motion_log(LOG_INFO,0,"Error decoding MJPEG"); - return 1; + if (!fileout){ + motion_log(LOG_ERR, 0, "%s: Error opening file: %s", __FUNCTION__, strerror(errno)); + exit(-1); } - memcpy(map, temp_netcam_buff.ptr, viddev->v4l_bufsize); - return 0; + fwrite((unsigned char *) the_buffer->ptr, the_buffer->content_length, 1,fileout); + + fclose(fileout); + exit(0); + } #endif case V4L2_PIX_FMT_JPEG: