ShowPicture: return boolean expression

This commit is contained in:
GetAway
2019-01-12 11:47:33 +01:00
parent 0b6120d170
commit 4f15222d9c
13 changed files with 57 additions and 28 deletions

View File

@@ -321,8 +321,9 @@ void cVideo::SetVideoMode(analog_mode_t mode)
proc_put("/proc/stb/avs/0/colorformat", m, strlen(m));
}
void cVideo::ShowPicture(const char * fname)
bool cVideo::ShowPicture(const char * fname)
{
bool ret = false;
hal_debug("%s(%s)\n", __func__, fname);
char destname[512];
char cmd[512];
@@ -334,18 +335,18 @@ void cVideo::ShowPicture(const char * fname)
{
/* does not work and the driver does not seem to like it */
hal_info("%s: video_standby == true\n", __func__);
return;
return ret;
}
if (fd < 0)
if (fd == -1)
{
hal_info("%s: decoder not opened?\n", __func__);
return;
hal_info("%s: decoder not opened\n", __func__);
return ret;
}
strcpy(destname, "/var/cache");
if (stat(fname, &st2))
{
hal_info("%s: could not stat %s (%m)\n", __func__, fname);
return;
return ret;
}
mkdir(destname, 0755);
/* the cache filename is (example for /share/tuxbox/neutrino/icons/radiomode.jpg):
@@ -395,10 +396,11 @@ void cVideo::ShowPicture(const char * fname)
read(mfd, iframe, st.st_size);
show_iframe(fd, iframe, st.st_size);
free(iframe);
ret = true;
out:
close(mfd);
pthread_mutex_unlock(&stillp_mutex);
return;
return ret;
}
void cVideo::StopPicture()