Skip to content

Commit

Permalink
Add a better check for sh4 hdmi output state
Browse files Browse the repository at this point in the history
  • Loading branch information
skl committed Aug 9, 2014
1 parent 80b993c commit 3c1069d
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions main.c
Expand Up @@ -1123,9 +1123,21 @@ void getvideo(unsigned char *video, int *xres, int *yres)
char *decode_surface;
int delay;

// It is necessary to check is hdmi is on, otherwise bpamem is not accessible
fp = fopen("/proc/stb/hdmi/output","r");
if (fp)
{
fgets(buf,sizeof(buf),fp);
fclose(fp);
if (strncmp(buf,"off",sizeof(buf)) == 0) {
fprintf(stderr, "HDMI output off. Not grabbing video...\n");
return;
}
}

// Initialize output variables
*xres=0;
*yres=0;
//*xres=0;
//*yres=0;

fp = fopen("/proc/stb/vmpeg/0/xres","r");
if (fp)
Expand Down

0 comments on commit 3c1069d

Please sign in to comment.