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,48 +113,35 @@ bool CStreamInstance::Stop()
|
||||
running = false;
|
||||
return (OpenThreads::Thread::join() == 0);
|
||||
}
|
||||
|
||||
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(61, 1, 100)
|
||||
bool CStreamInstance::Send(ssize_t r, const unsigned char *_buf)
|
||||
#else
|
||||
bool CStreamInstance::Send(ssize_t r, unsigned char * _buf)
|
||||
#endif
|
||||
{
|
||||
// lock fds for thread-safety
|
||||
// OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex);
|
||||
stream_fds_t cfds;
|
||||
mutex.lock();
|
||||
cfds = fds;
|
||||
mutex.unlock();
|
||||
|
||||
int flags = 0;
|
||||
if (cfds.size() > 1)
|
||||
flags = MSG_DONTWAIT;
|
||||
|
||||
// iterate through all client sockets
|
||||
for (auto it = cfds.begin(); it != cfds.end(); ++it)
|
||||
{
|
||||
for (stream_fds_t::iterator it = cfds.begin(); it != cfds.end(); ++it) {
|
||||
int i = 10;
|
||||
|
||||
// use a const pointer here to avoid conversion errors
|
||||
const unsigned char *b = _buf ? _buf : buf;
|
||||
ssize_t count = r;
|
||||
|
||||
do
|
||||
{
|
||||
// 'send' takes a const void*, so no cast needed
|
||||
do {
|
||||
int ret = send(*it, b, count, flags);
|
||||
if (ret > 0)
|
||||
{
|
||||
b += ret; // move pointer further
|
||||
count -= ret; // reduce remaining bytes
|
||||
if (ret > 0) {
|
||||
b += ret;
|
||||
count -= ret;
|
||||
}
|
||||
} 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);
|
||||
|
||||
printf("send err, fd %d: (%zd from %zd)\n", *it, r-count, r);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -69,6 +69,10 @@ class CCPicture : public CComponentsShapeSquare
|
||||
|
||||
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
|
||||
void setWidth(const int &w, bool keep_aspect = true);
|
||||
///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);
|
||||
|
||||
//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
|
||||
* @param[in] int w image width
|
||||
|
@@ -1234,8 +1234,12 @@ void CTimerList::paintItem(int pos)
|
||||
CTimerd::responseGetTimer &timer = timerlist[currpos];
|
||||
if (timer.eventType == CTimerd::TIMER_REMOTEBOX)
|
||||
{
|
||||
// mark remote timers with different text colors
|
||||
if (i_selected || i_marked)
|
||||
color = COL_MENUCONTENTSELECTED_TEXT_PLUS_2;
|
||||
else
|
||||
color = COL_MENUCONTENTINACTIVE_TEXT;
|
||||
bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0;
|
||||
|
||||
}
|
||||
char zAlarmTime[25] = {0};
|
||||
struct tm *alarmTime = localtime(&(timer.alarmTime));
|
||||
|
@@ -81,9 +81,6 @@ void CRecInfo::init()
|
||||
bool recordModeActive = crm->RecordingStatus();
|
||||
if (recordModeActive)
|
||||
{
|
||||
rec_icon = NEUTRINO_ICON_REC_GRAY;
|
||||
ts_icon = NEUTRINO_ICON_AUTO_SHIFT_GRAY;
|
||||
|
||||
// get current record count
|
||||
int records = crm->GetRecordCount();
|
||||
|
||||
@@ -97,12 +94,22 @@ void CRecInfo::init()
|
||||
int cur_rec_mode = crm->GetRecordMode(cur_chid);
|
||||
|
||||
// set 'active' icon for record mode
|
||||
if (rec_mode & CRecordManager::RECMODE_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
|
||||
if (rec_mode & CRecordManager::RECMODE_TSHIFT)
|
||||
{
|
||||
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)
|
||||
records--; // subtract ts
|
||||
|
Reference in New Issue
Block a user