Skip to content

Commit

Permalink
Small HISI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
teamblue-e2 committed Aug 12, 2023
1 parent 5b5fb8b commit d70b0f3
Show file tree
Hide file tree
Showing 3 changed files with 703 additions and 18 deletions.
4 changes: 2 additions & 2 deletions lib/dvb/decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1257,12 +1257,12 @@ RESULT eTSMPEGDecoder::showSinglePic(const char *filename)
{
struct stat s = {};
fstat(f, &s);
if (m_video_clip_fd == -1)
m_video_clip_fd = open("/dev/dvb/adapter0/video0", O_WRONLY);
#if HAVE_HISILICON
if (m_video_clip_fd >= 0)
finishShowSinglePic();
#endif
if (m_video_clip_fd == -1)
m_video_clip_fd = open("/dev/dvb/adapter0/video0", O_WRONLY);
if (m_video_clip_fd >= 0)
{
bool seq_end_avail = false;
Expand Down
37 changes: 21 additions & 16 deletions lib/dvb/filepush.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void eFilePushThread::thread()
if (d)
buf_end -= d;

if (buf_end == 0 || m_sof == 1)
if (buf_end == 0)
{
/* on EOF, try COMMITting once. */
if (m_send_pvr_commit)
Expand All @@ -130,18 +130,18 @@ void eFilePushThread::thread()
pfd.events = POLLIN;
switch (poll(&pfd, 1, 250)) // wait for 250ms
{
case 0:
eDebug("[eFilePushThread] wait for driver eof timeout");
continue;
case 1:
eDebug("[eFilePushThread] wait for driver eof ok");
case 0:
eDebug("[eFilePushThread] wait for driver eof timeout");
continue;
case 1:
eDebug("[eFilePushThread] wait for driver eof ok");
break;
default:
eDebug("[eFilePushThread] wait for driver eof aborted by signal");
/* Check m_stop after interrupted syscall. */
if (m_stop)
break;
default:
eDebug("[eFilePushThread] wait for driver eof aborted by signal");
/* Check m_stop after interrupted syscall. */
if (m_stop)
break;
continue;
continue;
}
}

Expand All @@ -151,10 +151,7 @@ void eFilePushThread::thread()
/* in stream_mode, we are sending EOF events
over and over until somebody responds.
in stream_mode, think of evtEOF as "buffer underrun occurred". */
if (m_sof == 0)
sendEvent(evtEOF);
else
sendEvent(evtUser); // start of file event
sendEvent(evtEOF);

if (m_stream_mode)
{
Expand Down Expand Up @@ -190,7 +187,12 @@ void eFilePushThread::thread()
break;
}
if (w < 0 && (errno == EINTR || errno == EAGAIN || errno == EBUSY))
{
#if HAVE_HISILICON
usleep(100000);
#endif
continue;
}
eDebug("[eFilePushThread] write: %m");
sendEvent(evtWriteError);
break;
Expand Down Expand Up @@ -583,6 +585,9 @@ void eFilePushThreadRecorder::thread()
if (errno == EINTR || errno == EBUSY)
{
eDebug("[eFilePushThreadRecorder] read got interrupted by signal, stop: %d", m_stop);
#if HAVE_HISILICON
usleep(100000);
#endif
continue;
}

Expand Down
Loading

0 comments on commit d70b0f3

Please sign in to comment.