- libarmbox/libmipsbox: some manual code nicenings

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2021-11-07 00:57:01 +01:00
committed by Thilo Graf
parent 3d7716ef08
commit 4e78667ace
8 changed files with 182 additions and 180 deletions

View File

@@ -198,8 +198,8 @@ static bool _open(cDemux *thiz, int num, int &fd, int &last_source, DMX_CHANNEL_
hal_info_z("%s %s: %m\n", __FUNCTION__, devname(0, devnum)); hal_info_z("%s %s: %m\n", __FUNCTION__, devname(0, devnum));
return false; return false;
} }
hal_debug_z("%s #%d pes_type: %s(%d), uBufferSize: %d fd: %d\n", __func__, hal_debug_z("%s #%d pes_type: %s(%d), uBufferSize: %d fd: %d\n",
num, DMX_T[dmx_type], dmx_type, buffersize, fd); __func__, num, DMX_T[dmx_type], dmx_type, buffersize, fd);
/* this would actually need locking, but the worst that weill happen is, that /* this would actually need locking, but the worst that weill happen is, that
* we'll DMX_SET_SOURCE twice per device, so don't bother... */ * we'll DMX_SET_SOURCE twice per device, so don't bother... */
@@ -465,8 +465,8 @@ bool cDemux::sectionFilter(unsigned short _pid, const unsigned char *const filte
if (timeout == 0 && negmask == NULL) if (timeout == 0 && negmask == NULL)
s_flt.timeout = to; s_flt.timeout = to;
hal_debug("%s #%d pid:0x%04hx fd:%d type:%s len:%d to:%d flags:%x flt[0]:%02x\n", __func__, num, hal_debug("%s #%d pid:0x%04hx fd:%d type:%s len:%d to:%d flags:%x flt[0]:%02x\n",
pid, fd, DMX_T[dmx_type], len, s_flt.timeout, s_flt.flags, s_flt.filter.filter[0]); __func__, num, pid, fd, DMX_T[dmx_type], len, s_flt.timeout, s_flt.flags, s_flt.filter.filter[0]);
if (debuglevel == 2) if (debuglevel == 2)
{ {
@@ -474,10 +474,10 @@ bool cDemux::sectionFilter(unsigned short _pid, const unsigned char *const filte
for (int i = 0; i < len; i++) fprintf(stderr, "%02hhx ", s_flt.filter.filter[i]); for (int i = 0; i < len; i++) fprintf(stderr, "%02hhx ", s_flt.filter.filter[i]);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
fprintf(stderr, "mask: "); fprintf(stderr, "mask: ");
for (int i = 0; i < len; i++) fprintf(stderr, "%02hhx ", s_flt.filter.mask [i]); for (int i = 0; i < len; i++) fprintf(stderr, "%02hhx ", s_flt.filter.mask[i]);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
fprintf(stderr, "mode: "); fprintf(stderr, "mode: ");
for (int i = 0; i < len; i++) fprintf(stderr, "%02hhx ", s_flt.filter.mode [i]); for (int i = 0; i < len; i++) fprintf(stderr, "%02hhx ", s_flt.filter.mode[i]);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
} }

View File

@@ -56,7 +56,7 @@
int _r; \ int _r; \
if (fd >= 0) { \ if (fd >= 0) { \
if ((_r = ::cmd(fd, args)) < 0) \ if ((_r = ::cmd(fd, args)) < 0) \
hal_info(#cmd"(fd, "#args")\n"); \ hal_info(#cmd"(fd, "#args")\n");\
else \ else \
hal_debug(#cmd"(fd, "#args")\n");\ hal_debug(#cmd"(fd, "#args")\n");\
} \ } \
@@ -689,9 +689,7 @@ void hdmi_cec::Receive(int what)
case CEC_OPCODE_DEVICE_VENDOR_ID: case CEC_OPCODE_DEVICE_VENDOR_ID:
case CEC_OPCODE_VENDOR_COMMAND_WITH_ID: case CEC_OPCODE_VENDOR_COMMAND_WITH_ID:
{ {
uint64_t iVendorId = ((uint64_t)rxmessage.data[1] << 16) + uint64_t iVendorId = ((uint64_t)rxmessage.data[1] << 16) + ((uint64_t)rxmessage.data[2] << 8) + (uint64_t)rxmessage.data[3];
((uint64_t)rxmessage.data[2] << 8) +
(uint64_t)rxmessage.data[3];
hal_info(GREEN "[CEC] decoded message '%s' (%s)\n" NORMAL, ToString((cec_opcode)rxmessage.opcode), ToString((cec_vendor_id)iVendorId)); hal_info(GREEN "[CEC] decoded message '%s' (%s)\n" NORMAL, ToString((cec_opcode)rxmessage.opcode), ToString((cec_vendor_id)iVendorId));
break; break;
} }

View File

@@ -236,8 +236,8 @@ bool cPlayback::Start(char *filename, int vpid, int vtype, int apid, int ac3, in
free(TrackList); free(TrackList);
} }
} }
*/ */
//Chapters //Chapters
if (player && player->manager && player->manager->chapter) if (player && player->manager && player->manager->chapter)
{ {
@@ -582,13 +582,13 @@ void cPlayback::FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t
else if (!strncmp("A_AAC", TrackList[i + 1], 5)) else if (!strncmp("A_AAC", TrackList[i + 1], 5))
ac3flags[j] = 5; ac3flags[j] = 5;
else if (!strncmp("A_PCM", TrackList[i + 1], 5)) else if (!strncmp("A_PCM", TrackList[i + 1], 5))
ac3flags[j] = 0; //todo ac3flags[j] = 0; // todo
else if (!strncmp("A_VORBIS", TrackList[i + 1], 8)) else if (!strncmp("A_VORBIS", TrackList[i + 1], 8))
ac3flags[j] = 0; //todo ac3flags[j] = 0; // todo
else if (!strncmp("A_FLAC", TrackList[i + 1], 6)) else if (!strncmp("A_FLAC", TrackList[i + 1], 6))
ac3flags[j] = 0; //todo ac3flags[j] = 0; // todo
else else
ac3flags[j] = 0; //todo ac3flags[j] = 0; // todo
std::string _language = ""; std::string _language = "";
_language += std::string(_lang); _language += std::string(_lang);
if (_language.compare("und") == 0) if (_language.compare("und") == 0)
@@ -652,7 +652,8 @@ void cPlayback::FindAllTeletextsubtitlePids(int */*pids*/, unsigned int *numpids
//int max_numpids = *numpids; //int max_numpids = *numpids;
*numpids = 0; *numpids = 0;
/* if (player && player->manager && player->manager->teletext) /*
if (player && player->manager && player->manager->teletext)
{ {
char **TrackList = NULL; char **TrackList = NULL;
player->manager->teletext->Command(player, MANAGER_LIST, &TrackList); player->manager->teletext->Command(player, MANAGER_LIST, &TrackList);
@@ -681,7 +682,8 @@ void cPlayback::FindAllTeletextsubtitlePids(int */*pids*/, unsigned int *numpids
free(TrackList); free(TrackList);
*numpids = j; *numpids = j;
} }
} */ }
*/
} }
int cPlayback::GetTeletextPid(void) int cPlayback::GetTeletextPid(void)
@@ -689,7 +691,8 @@ int cPlayback::GetTeletextPid(void)
hal_info("%s\n", __func__); hal_info("%s\n", __func__);
int pid = -1; int pid = -1;
/* if (player && player->manager && player->manager->teletext) /*
if (player && player->manager && player->manager->teletext)
{ {
char **TrackList = NULL; char **TrackList = NULL;
player->manager->teletext->Command(player, MANAGER_LIST, &TrackList); player->manager->teletext->Command(player, MANAGER_LIST, &TrackList);
@@ -700,7 +703,7 @@ int cPlayback::GetTeletextPid(void)
for (i = 0; TrackList[i] != NULL; i += 2) for (i = 0; TrackList[i] != NULL; i += 2)
{ {
int type = 0; int type = 0;
printf("\t%s - %s\n", TrackList[i], TrackList[i+1]); printf("\t%s - %s\n", TrackList[i], TrackList[i + 1]);
if (pid < 0) if (pid < 0)
{ {
if (2 != sscanf(TrackList[i], "%*d %d %*s %d %*d %*d", &pid, &type)) if (2 != sscanf(TrackList[i], "%*d %d %*s %d %*d %*d", &pid, &type))
@@ -713,7 +716,8 @@ int cPlayback::GetTeletextPid(void)
} }
free(TrackList); free(TrackList);
} }
} */ }
*/
printf("teletext pid id %d (0x%x)\n", pid, pid); printf("teletext pid id %d (0x%x)\n", pid, pid);
return pid; return pid;

View File

@@ -286,8 +286,8 @@ void cRecord::RecordThread()
if (toread > readsize) if (toread > readsize)
toread = readsize; toread = readsize;
ssize_t s = dmx->Read(buf + buf_pos, toread, 50); ssize_t s = dmx->Read(buf + buf_pos, toread, 50);
hal_debug("%s: buf_pos %6d s %6d / %6d\n", __func__, hal_debug("%s: buf_pos %6d s %6d / %6d\n",
buf_pos, (int)s, bufsize - buf_pos); __func__, buf_pos, (int)s, bufsize - buf_pos);
if (s < 0) if (s < 0)
{ {
if (errno != EAGAIN && (errno != EOVERFLOW || !overflow)) if (errno != EAGAIN && (errno != EOVERFLOW || !overflow))

View File

@@ -189,8 +189,8 @@ static const char *vid_modes[] =
"1080p25", // VIDEO_STD_1080P25 "1080p25", // VIDEO_STD_1080P25
"1080p50", // VIDEO_STD_1080P50 "1080p50", // VIDEO_STD_1080P50
"1080p60", // VIDEO_STD_1080P60 "1080p60", // VIDEO_STD_1080P60
"1080p2397", // VIDEO_STD_1080P2397 "1080p2397",// VIDEO_STD_1080P2397
"1080p2997", // VIDEO_STD_1080P2997 "1080p2997",// VIDEO_STD_1080P2997
"2160p24", // VIDEO_STD_2160P24 "2160p24", // VIDEO_STD_2160P24
"2160p25", // VIDEO_STD_2160P25 "2160p25", // VIDEO_STD_2160P25
"2160p30", // VIDEO_STD_2160P30 "2160p30", // VIDEO_STD_2160P30