Commit afababf2 authored by Jean-Paul Saman's avatar Jean-Paul Saman

fb: fix working

parent c1b694d1
......@@ -105,7 +105,7 @@ static void GfxMode ( int i_tty );
#define HW_ACCEL_TEXT N_("Framebuffer uses hw acceleration.")
#define HW_ACCEL_LONGTEXT N_( \
"If your framebuffer supports hardware acceleration or does double buffering " \
"If your framebuffer does not support hardware acceleration or double buffering " \
"in hardware then you must disable this option. It then does double buffering " \
"in software." )
......@@ -115,7 +115,7 @@ vlc_module_begin ()
set_subcategory( SUBCAT_VIDEO_VOUT )
add_file( FB_DEV_VAR, "/dev/fb0", NULL, DEVICE_TEXT, DEVICE_LONGTEXT,
false )
add_string( "fb-name", "dm_vid0_fb", NULL, NAME_TEXT, NAME_LONGTEXT,
add_string( "fb-name", "", NULL, NAME_TEXT, NAME_LONGTEXT,
false );
add_bool( "fb-tty", 1, NULL, TTY_TEXT, TTY_LONGTEXT, true )
......@@ -769,13 +769,15 @@ static int OpenFbByName( const char *psz_name )
{
int i_fd = -1;
int i; /* begins with /dev/fb0 */
char *psz_device;
struct fb_fix_screeninfo info;
for( i = 0; i < FB_MAX; i++ )
{
if( asprintf( &psz_device, "/dev/fb%d", i++ ) == -1 )
char *psz_device;
if( asprintf( &psz_device, "/dev/fb%d", i ) == -1 )
return -1;
i_fd = open( psz_device, O_RDWR);
free( psz_device );
......@@ -788,7 +790,7 @@ static int OpenFbByName( const char *psz_name )
continue;
}
if( !strcmp( info.id, psz_name ) )
if( strcmp( info.id, psz_name ) == 0 )
return i_fd;
close( i_fd );
......@@ -806,16 +808,18 @@ static int OpenDisplay( vout_thread_t *p_vout )
struct fb_fix_screeninfo fix_info; /* framebuffer fix information */
/* Open framebuffer device */
if( (psz_device = config_GetPsz( p_vout, "fb-name" )) )
psz_device = var_CreateGetString( p_vout, "fb-name" );
if( psz_device )
{
if( (p_sys->i_fd = OpenFbByName( psz_device )) == -1 )
p_sys->i_fd = OpenFbByName( psz_device );
if( p_sys->i_fd == -1 )
{
msg_Err( p_vout, "cannot open fb by name %s (%m)", psz_device );
free( psz_device );
return VLC_EGENERIC;
}
}
else if( (psz_device = config_GetPsz( p_vout, FB_DEV_VAR )) )
else if( (psz_device = var_CreateGetString( p_vout, FB_DEV_VAR )) )
{
p_sys->i_fd = open( psz_device, O_RDWR );
if( p_sys->i_fd == -1 )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment