mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-26 23:13:13 +02:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
0a129a081f | ||
|
bda8caf354 | ||
|
df3574bad5 | ||
|
afe0b116c0 |
@@ -113,49 +113,36 @@ bool CStreamInstance::Stop()
|
|||||||
running = false;
|
running = false;
|
||||||
return (OpenThreads::Thread::join() == 0);
|
return (OpenThreads::Thread::join() == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(61, 1, 100)
|
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(61, 1, 100)
|
||||||
bool CStreamInstance::Send(ssize_t r, const unsigned char *_buf)
|
bool CStreamInstance::Send(ssize_t r, const unsigned char *_buf)
|
||||||
#else
|
#else
|
||||||
bool CStreamInstance::Send(ssize_t r, unsigned char * _buf)
|
bool CStreamInstance::Send(ssize_t r, unsigned char * _buf)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
// lock fds for thread-safety
|
// OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex);
|
||||||
stream_fds_t cfds;
|
stream_fds_t cfds;
|
||||||
mutex.lock();
|
mutex.lock();
|
||||||
cfds = fds;
|
cfds = fds;
|
||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
|
int flags = 0;
|
||||||
int flags = 0;
|
if (cfds.size() > 1)
|
||||||
if (cfds.size() > 1)
|
flags = MSG_DONTWAIT;
|
||||||
flags = MSG_DONTWAIT;
|
for (stream_fds_t::iterator it = cfds.begin(); it != cfds.end(); ++it) {
|
||||||
|
int i = 10;
|
||||||
// iterate through all client sockets
|
const unsigned char *b = _buf ? _buf : buf;
|
||||||
for (auto it = cfds.begin(); it != cfds.end(); ++it)
|
ssize_t count = r;
|
||||||
{
|
do {
|
||||||
int i = 10;
|
int ret = send(*it, b, count, flags);
|
||||||
|
if (ret > 0) {
|
||||||
// use a const pointer here to avoid conversion errors
|
b += ret;
|
||||||
const unsigned char *b = _buf ? _buf : buf;
|
count -= ret;
|
||||||
ssize_t count = r;
|
}
|
||||||
|
} while ((count > 0) && (i-- > 0));
|
||||||
do
|
if (count)
|
||||||
{
|
printf("send err, fd %d: (%zd from %zd)\n", *it, r-count, r);
|
||||||
// 'send' takes a const void*, so no cast needed
|
}
|
||||||
int ret = send(*it, b, count, flags);
|
return true;
|
||||||
if (ret > 0)
|
|
||||||
{
|
|
||||||
b += ret; // move pointer further
|
|
||||||
count -= ret; // reduce remaining bytes
|
|
||||||
}
|
|
||||||
} while ((count > 0) && (i-- > 0));
|
|
||||||
|
|
||||||
// if count didn't drop to zero, there was some error
|
|
||||||
if (count)
|
|
||||||
printf("CStreamInstance::%s: send error, fd %d: (%zd from %zd)\n", __FUNCTION__, *it, r - count, r);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CStreamInstance::Close()
|
void CStreamInstance::Close()
|
||||||
|
@@ -69,6 +69,10 @@ class CCPicture : public CComponentsShapeSquare
|
|||||||
|
|
||||||
void SetTransparent(const int &mode) {setBodyBGImageTranparencyMode(mode);}
|
void SetTransparent(const int &mode) {setBodyBGImageTranparencyMode(mode);}
|
||||||
|
|
||||||
|
///import base class methods for width and height to avoid -Woverloaded-virtual
|
||||||
|
using CCDraw::setWidth;
|
||||||
|
using CCDraw::setHeight;
|
||||||
|
|
||||||
///set width of object, keep_aspect = true keeps ratio related to height
|
///set width of object, keep_aspect = true keeps ratio related to height
|
||||||
void setWidth(const int &w, bool keep_aspect = true);
|
void setWidth(const int &w, bool keep_aspect = true);
|
||||||
///set height of object, keep_aspect = true keeps ratio related to width
|
///set height of object, keep_aspect = true keeps ratio related to width
|
||||||
@@ -281,6 +285,10 @@ class CComponentsPicture : public CComponentsForm
|
|||||||
*/
|
*/
|
||||||
void SetTransparent(const int &mode);
|
void SetTransparent(const int &mode);
|
||||||
|
|
||||||
|
//import base class methods for width and height to avoid -Woverloaded-virtual
|
||||||
|
using CCDraw::setWidth;
|
||||||
|
using CCDraw::setHeight;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Sets width of object, keep_aspect = true keeps ratio related to height
|
Sets width of object, keep_aspect = true keeps ratio related to height
|
||||||
* @param[in] int w image width
|
* @param[in] int w image width
|
||||||
|
@@ -1234,8 +1234,12 @@ void CTimerList::paintItem(int pos)
|
|||||||
CTimerd::responseGetTimer &timer = timerlist[currpos];
|
CTimerd::responseGetTimer &timer = timerlist[currpos];
|
||||||
if (timer.eventType == CTimerd::TIMER_REMOTEBOX)
|
if (timer.eventType == CTimerd::TIMER_REMOTEBOX)
|
||||||
{
|
{
|
||||||
color = COL_MENUCONTENTINACTIVE_TEXT;
|
// mark remote timers with different text colors
|
||||||
bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0;
|
if (i_selected || i_marked)
|
||||||
|
color = COL_MENUCONTENTSELECTED_TEXT_PLUS_2;
|
||||||
|
else
|
||||||
|
color = COL_MENUCONTENTINACTIVE_TEXT;
|
||||||
|
|
||||||
}
|
}
|
||||||
char zAlarmTime[25] = {0};
|
char zAlarmTime[25] = {0};
|
||||||
struct tm *alarmTime = localtime(&(timer.alarmTime));
|
struct tm *alarmTime = localtime(&(timer.alarmTime));
|
||||||
|
@@ -81,9 +81,6 @@ void CRecInfo::init()
|
|||||||
bool recordModeActive = crm->RecordingStatus();
|
bool recordModeActive = crm->RecordingStatus();
|
||||||
if (recordModeActive)
|
if (recordModeActive)
|
||||||
{
|
{
|
||||||
rec_icon = NEUTRINO_ICON_REC_GRAY;
|
|
||||||
ts_icon = NEUTRINO_ICON_AUTO_SHIFT_GRAY;
|
|
||||||
|
|
||||||
// get current record count
|
// get current record count
|
||||||
int records = crm->GetRecordCount();
|
int records = crm->GetRecordCount();
|
||||||
|
|
||||||
@@ -97,12 +94,22 @@ void CRecInfo::init()
|
|||||||
int cur_rec_mode = crm->GetRecordMode(cur_chid);
|
int cur_rec_mode = crm->GetRecordMode(cur_chid);
|
||||||
|
|
||||||
// set 'active' icon for record mode
|
// set 'active' icon for record mode
|
||||||
if (cur_rec_mode & CRecordManager::RECMODE_REC)
|
if (rec_mode & CRecordManager::RECMODE_REC)
|
||||||
rec_icon = NEUTRINO_ICON_REC;
|
{
|
||||||
|
if (cur_rec_mode & CRecordManager::RECMODE_REC)
|
||||||
|
rec_icon = NEUTRINO_ICON_REC;
|
||||||
|
else
|
||||||
|
rec_icon = NEUTRINO_ICON_REC_GRAY;
|
||||||
|
}
|
||||||
|
|
||||||
// set 'active' icon for timeshift mode
|
// set 'active' icon for timeshift mode
|
||||||
if (cur_rec_mode & CRecordManager::RECMODE_TSHIFT)
|
if (rec_mode & CRecordManager::RECMODE_TSHIFT)
|
||||||
ts_icon = NEUTRINO_ICON_AUTO_SHIFT;
|
{
|
||||||
|
if (cur_rec_mode & CRecordManager::RECMODE_TSHIFT)
|
||||||
|
ts_icon = NEUTRINO_ICON_AUTO_SHIFT;
|
||||||
|
else
|
||||||
|
ts_icon = NEUTRINO_ICON_AUTO_SHIFT_GRAY;
|
||||||
|
}
|
||||||
|
|
||||||
if (rec_mode == CRecordManager::RECMODE_REC_TSHIFT)
|
if (rec_mode == CRecordManager::RECMODE_REC_TSHIFT)
|
||||||
records--; // subtract ts
|
records--; // subtract ts
|
||||||
|
Reference in New Issue
Block a user