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

@@ -235,8 +235,9 @@ void cVideo::SetVideoMode(analog_mode_t)
{
}
void cVideo::ShowPicture(const char *fname)
bool cVideo::ShowPicture(const char *fname)
{
bool ret = false;
hal_info("%s(%s)\n", __func__, fname);
if (access(fname, R_OK))
return;
@@ -260,7 +261,7 @@ void cVideo::ShowPicture(const char *fname)
if (avformat_open_input(&avfc, fname, NULL, NULL) < 0) {
hal_info("%s: Could not open file %s\n", __func__, fname);
return;
return ret;
}
if (avformat_find_stream_info(avfc, NULL) < 0) {
@@ -333,6 +334,7 @@ void cVideo::ShowPicture(const char *fname)
buf_num--;
}
buf_m.unlock();
ret = true;
}
}
av_packet_unref(&avpkt);
@@ -344,6 +346,7 @@ void cVideo::ShowPicture(const char *fname)
out_close:
avformat_close_input(&avfc);
hal_debug("%s(%s) end\n", __func__, fname);
return ret;
}
void cVideo::StopPicture()

View File

@@ -180,7 +180,7 @@ class cVideo : public OpenThreads::Thread
bool Pause(void);
int SetStreamType(VIDEO_FORMAT type);
void ShowPicture(const char * fname);
bool ShowPicture(const char * fname);
void SetSyncMode(AVSYNC_TYPE mode);
bool SetCECMode(VIDEO_HDMI_CEC_MODE) { return true; };