change the way v4l_multi_buffer is loaded. Since t's a bool, it theoretically is 1 byte, so can't use atoi

This commit is contained in:
Isaac Connor 2014-07-14 12:53:48 -04:00 committed by Jan M. Hochstein
parent c80bf07ea7
commit 5cc74c3941
2 changed files with 6 additions and 7 deletions

View File

@ -783,8 +783,8 @@ void LocalCamera::Initialise()
Debug( 3, "Setting up request buffers" );
memset( &v4l2_data.reqbufs, 0, sizeof(v4l2_data.reqbufs) );
if ( channel_count > 1 )
if ( v4l_multi_buffer )
if ( channel_count > 1 ) {
if ( v4l_multi_buffer ){
v4l2_data.reqbufs.count = 2*channel_count;
} else {
v4l2_data.reqbufs.count = 1;
@ -792,7 +792,6 @@ void LocalCamera::Initialise()
} else {
v4l2_data.reqbufs.count = 8;
}
Debug( 3, "Request buffers count is %d", v4l2_data.reqbufs.count );
v4l2_data.reqbufs.type = v4l2_data.fmt.type;
v4l2_data.reqbufs.memory = V4L2_MEMORY_MMAP;
@ -812,7 +811,7 @@ void LocalCamera::Initialise()
if ( v4l2_data.reqbufs.count < (v4l_multi_buffer?2:1) )
Fatal( "Insufficient buffer memory %d on video device", v4l2_data.reqbufs.count );
Debug( 3, "Setting up data buffers: Channels %d MultiBuffer %d Buffers: %d", channel_count, v4l_multi_buffer, v4l2_data.reqbufs.count );
Debug( 3, "Setting up data buffers: Channels %d MultiBuffer %d Buffers: %s", channel_count, v4l_multi_buffer, v4l2_data.reqbufs.count );
v4l2_data.buffers = new V4L2MappedBuffer[v4l2_data.reqbufs.count];
#if HAVE_LIBSWSCALE

View File

@ -1868,7 +1868,7 @@ int Monitor::LoadLocalMonitors( const char *device, Monitor **&monitors, Purpose
const char *device = dbrow[col]; col++;
int channel = atoi(dbrow[col]); col++;
int format = atoi(dbrow[col]); col++;
bool v4l_multi_buffer = atoi(dbrow[col]); col++;
bool v4l_multi_buffer = (*dbrow[col] == 48 ? false : true); col++;
int v4l_captures_per_frame = atoi(dbrow[col]); col++;
const char *method = dbrow[col]; col++;
@ -2470,7 +2470,7 @@ Monitor *Monitor::Load( int id, bool load_zones, Purpose purpose )
std::string device = dbrow[col]; col++;
int channel = atoi(dbrow[col]); col++;
int format = atoi(dbrow[col]); col++;
bool v4l_multi_buffer = atoi(dbrow[col]); col++;
bool v4l_multi_buffer = (*dbrow[col] == 48 ? false : true); col++;
int v4l_captures_per_frame = atoi(dbrow[col]); col++;
bool v4l_multi_buffer;