diff --git a/common/ca_ci.cpp b/common/ca_ci.cpp index 504b092..728dc02 100644 --- a/common/ca_ci.cpp +++ b/common/ca_ci.cpp @@ -45,8 +45,8 @@ static bool checkLiveSlot = false; static bool CertChecked = false; static bool Cert_OK = false; static uint8_t NullPMT[50] = {0x9F, 0x80, 0x32, 0x2E, 0x03, 0x6E, 0xA7, 0x37, 0x00, 0x00, 0x1B, 0x15, 0x7D, 0x00, 0x00, 0x03, 0x15, 0x7E, 0x00, 0x00, 0x03, 0x15, 0x7F, 0x00, - 0x00, 0x06, 0x15, 0x80, 0x00, 0x00, 0x06, 0x15, 0x82, 0x00, 0x00, 0x0B, 0x08, 0x7B, 0x00, 0x00, 0x05, 0x09, 0x42, 0x00, 0x00, 0x06, 0x15, 0x81, 0x00, 0x00 - }; + 0x00, 0x06, 0x15, 0x80, 0x00, 0x00, 0x06, 0x15, 0x82, 0x00, 0x00, 0x0B, 0x08, 0x7B, 0x00, 0x00, 0x05, 0x09, 0x42, 0x00, 0x00, 0x06, 0x15, 0x81, 0x00, 0x00 + }; static cCA *pcCAInstance = NULL; /* für callback */ @@ -107,7 +107,8 @@ void cCA::write_ci_info(int slot, CaIdVector caids) snprintf(fname, sizeof(fname), "/tmp/ci-slot%d", slot); ModuleName(CA_SLOT_TYPE_CI, slot, mname); FILE *fd = fopen(fname, "w"); - if (fd == NULL) return; + if (fd == NULL) + return; snprintf(buf, sizeof(buf), "%s\n", mname); fputs(buf, fd); if (caids.size() > 40) @@ -129,7 +130,8 @@ void cCA::del_ci_info(int slot) { char fname[20]; snprintf(fname, sizeof(fname), "/tmp/ci-slot%d", slot); - if (access(fname, F_OK) == 0) remove(fname); + if (access(fname, F_OK) == 0) + remove(fname); } /* helper function to call the cpp thread loop */ @@ -143,7 +145,7 @@ void *execute_thread(void *c) /* from dvb-apps */ int asn_1_decode(uint16_t *length, unsigned char *asn_1_array, - uint32_t asn_1_array_len) + uint32_t asn_1_array_len) { uint8_t length_field; @@ -645,7 +647,8 @@ bool cCA::SendCAPMT(u64 tpid, u8 source, u8 camask, const unsigned char *cabuf, bool sid_found = false; bool recordUse_found = false; printf("%s -> %s\n", FILENAME, __func__); - if (!num_slots) return true; /* stb's without ci-slots */ + if (!num_slots) + return true; /* stb's without ci-slots */ #if x_debug printf("TP: %llX\n", TP); printf("SID: %04X\n", SID); @@ -727,7 +730,7 @@ bool cCA::SendCAPMT(u64 tpid, u8 source, u8 camask, const unsigned char *cabuf, (*It)->pmtlen = calen; for (i = 0; i < calen; i++) (*It)->pmtdata[i] = cabuf[i]; - (*It)->pmtdata[pos] = 0x04; // CAPMT_ADD + (*It)->pmtdata[pos] = 0x04; // CAPMT_ADD (*It)->newCapmt = true; } diff --git a/common/proc_tools.c b/common/proc_tools.c index 74761ce..eed9215 100644 --- a/common/proc_tools.c +++ b/common/proc_tools.c @@ -10,8 +10,8 @@ #include #include #include -#include /* isspace */ -#include /* sscanf */ +#include /* isspace */ +#include /* sscanf */ #include "proc_tools.h" @@ -39,8 +39,8 @@ int proc_get(const char *path, char *value, const int len) if (ret >= 0) { while (ret > 0 && isspace(value[ret - 1])) - ret--; /* remove trailing whitespace */ - value[ret] = '\0'; /* terminate, even if ret = 0 */ + ret--; /* remove trailing whitespace */ + value[ret] = '\0'; /* terminate, even if ret = 0 */ } ret2 = close(pfd); if (ret2 < 0) diff --git a/libarmbox/dmx.cpp b/libarmbox/dmx.cpp index 1264998..2491fce 100644 --- a/libarmbox/dmx.cpp +++ b/libarmbox/dmx.cpp @@ -469,13 +469,16 @@ bool cDemux::sectionFilter(unsigned short _pid, const unsigned char *const filte if (debuglevel == 2) { fprintf(stderr, "filt: "); - 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, "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, "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"); } diff --git a/libarmbox/hardware_caps.c b/libarmbox/hardware_caps.c index bb9a1f3..7ebcc39 100644 --- a/libarmbox/hardware_caps.c +++ b/libarmbox/hardware_caps.c @@ -29,10 +29,14 @@ hw_caps_t *get_hwcaps(void) memset(&caps, 0, sizeof(hw_caps_t)); caps.pip_devs = 0; - if (access("/dev/dvb/adapter0/video1", F_OK) != -1) caps.pip_devs = 1; - if (access("/dev/dvb/adapter0/video2", F_OK) != -1) caps.pip_devs = 2; - if (access("/dev/dvb/adapter0/video3", F_OK) != -1) caps.pip_devs = 3; - if (caps.pip_devs > 0) caps.can_pip = 1; + if (access("/dev/dvb/adapter0/video1", F_OK) != -1) + caps.pip_devs = 1; + if (access("/dev/dvb/adapter0/video2", F_OK) != -1) + caps.pip_devs = 2; + if (access("/dev/dvb/adapter0/video3", F_OK) != -1) + caps.pip_devs = 3; + if (caps.pip_devs > 0) + caps.can_pip = 1; #if BOXMODEL_VUSOLO4K caps.has_CI = 1; diff --git a/libarmbox/playback_libeplayer3.cpp b/libarmbox/playback_libeplayer3.cpp index d52a95d..a4f4a0c 100644 --- a/libarmbox/playback_libeplayer3.cpp +++ b/libarmbox/playback_libeplayer3.cpp @@ -693,7 +693,7 @@ int cPlayback::GetTeletextPid(void) /* if (player && player->manager && player->manager->teletext) - { + { char **TrackList = NULL; player->manager->teletext->Command(player, MANAGER_LIST, &TrackList); if (TrackList != NULL) diff --git a/libarmbox/video.cpp b/libarmbox/video.cpp index aaac76d..d1172b9 100644 --- a/libarmbox/video.cpp +++ b/libarmbox/video.cpp @@ -918,11 +918,13 @@ void cVideo::QuadPiP(bool active, int _x, int _y, int _w, int _h) { char buffer[64]; int _a = 1; - if (active) { + if (active) + { #if BOXMODEL_VUSOLO4K || BOXMODEL_VUDUO4K || BOXMODEL_VUDUO4KSE || BOXMODEL_VUULTIMO4K || BOXMODEL_VUUNO4KSE || BOXMODEL_VUUNO4K proc_put("/proc/stb/video/decodermode", "mosaic", strlen("mosaic")); #endif - for (unsigned int i = 0; i < 4; i++) { + for (unsigned int i = 0; i < 4; i++) + { sprintf(buffer, "%x", _x); proc_put(VMPEG_dst_left[i], buffer, strlen(buffer)); sprintf(buffer, "%x", _y); @@ -934,8 +936,11 @@ void cVideo::QuadPiP(bool active, int _x, int _y, int _w, int _h) sprintf(buffer, "%x", _a); proc_put(VMPEG_dst_apply[i], buffer, strlen(buffer)); } - } else { - for (unsigned int i = 0; i < 4; i++) { + } + else + { + for (unsigned int i = 0; i < 4; i++) + { sprintf(buffer, "%x", 0); proc_put(VMPEG_dst_left[i], buffer, strlen(buffer)); sprintf(buffer, "%x", 0); diff --git a/libgeneric-pc/audio.cpp b/libgeneric-pc/audio.cpp index 8cabc0b..ef503ac 100644 --- a/libgeneric-pc/audio.cpp +++ b/libgeneric-pc/audio.cpp @@ -391,11 +391,11 @@ void cAudio::run() #endif inp = av_find_input_format("mpegts"); AVIOContext *pIOCtx = avio_alloc_context(inbuf, INBUF_SIZE, // internal Buffer and its size - 0, // bWriteable (1=true,0=false) - NULL, // user data; will be passed to our callback functions - _my_read, // read callback - NULL, // write callback - NULL); // seek callback + 0, // bWriteable (1=true,0=false) + NULL, // user data; will be passed to our callback functions + _my_read, // read callback + NULL, // write callback + NULL); // seek callback avfc = avformat_alloc_context(); avfc->pb = pIOCtx; avfc->iformat = inp; @@ -473,9 +473,9 @@ void cAudio::run() av_get_sample_fmt_string(tmp, sizeof(tmp), c->sample_fmt); hal_info("decoding %s, sample_fmt %d (%s) sample_rate %d channels %d\n", avcodec_get_name(p->codec_id), c->sample_fmt, tmp, p->sample_rate, p->channels); swr = swr_alloc_set_opts(swr, - o_layout, AV_SAMPLE_FMT_S16, o_sr, /* output */ - p->channel_layout, c->sample_fmt, p->sample_rate, /* input */ - 0, NULL); + o_layout, AV_SAMPLE_FMT_S16, o_sr, /* output */ + p->channel_layout, c->sample_fmt, p->sample_rate, /* input */ + 0, NULL); if (! swr) { hal_info("could not alloc resample context\n"); diff --git a/libgeneric-pc/dmx.cpp b/libgeneric-pc/dmx.cpp index b08c81b..fef8e34 100644 --- a/libgeneric-pc/dmx.cpp +++ b/libgeneric-pc/dmx.cpp @@ -203,7 +203,8 @@ int cDemux::Read(unsigned char *buff, int len, int timeout) * return from read(), so as a "emergency exit" for e.g. NIT scan, set a (long) * timeout here */ int to = timeout; - if (dmx_type == DMX_PSI_CHANNEL && timeout <= 0){ + if (dmx_type == DMX_PSI_CHANNEL && timeout <= 0) + { to = 60 * 1000; } @@ -363,13 +364,16 @@ bool cDemux::sectionFilter(unsigned short _pid, const unsigned char *const filte if (debuglevel == 2) { fprintf(stderr, "filt: "); - for (int i = 0; i < DMX_FILTER_SIZE; i++)fprintf(stderr, "%02hhx ", s_flt.filter.filter[i]); + for (int i = 0; i < DMX_FILTER_SIZE; i++) + fprintf(stderr, "%02hhx ", s_flt.filter.filter[i]); fprintf(stderr, "\n"); fprintf(stderr, "mask: "); - for (int i = 0; i < DMX_FILTER_SIZE; i++)fprintf(stderr, "%02hhx ", s_flt.filter.mask[i]); + for (int i = 0; i < DMX_FILTER_SIZE; i++) + fprintf(stderr, "%02hhx ", s_flt.filter.mask[i]); fprintf(stderr, "\n"); fprintf(stderr, "mode: "); - for (int i = 0; i < DMX_FILTER_SIZE; i++)fprintf(stderr, "%02hhx ", s_flt.filter.mode[i]); + for (int i = 0; i < DMX_FILTER_SIZE; i++) + fprintf(stderr, "%02hhx ", s_flt.filter.mode[i]); fprintf(stderr, "\n"); } diff --git a/libgeneric-pc/video.cpp b/libgeneric-pc/video.cpp index 5c8c77e..487d072 100644 --- a/libgeneric-pc/video.cpp +++ b/libgeneric-pc/video.cpp @@ -349,8 +349,8 @@ bool cVideo::ShowPicture(const char *fname) { unsigned int need = av_image_get_buffer_size(VDEC_PIXFMT, c->width, c->height, 1); struct SwsContext *convert = sws_getContext(c->width, c->height, c->pix_fmt, - c->width, c->height, VDEC_PIXFMT, - SWS_BICUBIC, 0, 0, 0); + c->width, c->height, VDEC_PIXFMT, + SWS_BICUBIC, 0, 0, 0); if (!convert) hal_info("%s: ERROR setting up SWS context\n", __func__); else @@ -541,11 +541,11 @@ void cVideo::run(void) #endif inp = av_find_input_format("mpegts"); AVIOContext *pIOCtx = avio_alloc_context(inbuf, INBUF_SIZE, // internal Buffer and its size - 0, // bWriteable (1=true,0=false) - NULL, // user data; will be passed to our callback functions - my_read, // read callback - NULL, // write callback - NULL); // seek callback + 0, // bWriteable (1=true,0=false) + NULL, // user data; will be passed to our callback functions + my_read, // read callback + NULL, // write callback + NULL); // seek callback avfc = avformat_alloc_context(); avfc->pb = pIOCtx; avfc->iformat = inp; @@ -639,9 +639,9 @@ void cVideo::run(void) { unsigned int need = av_image_get_buffer_size(VDEC_PIXFMT, c->width, c->height, 1); convert = sws_getCachedContext(convert, - c->width, c->height, c->pix_fmt, - c->width, c->height, VDEC_PIXFMT, - SWS_BICUBIC, 0, 0, 0); + c->width, c->height, c->pix_fmt, + c->width, c->height, VDEC_PIXFMT, + SWS_BICUBIC, 0, 0, 0); if (!convert) hal_info("%s: ERROR setting up SWS context\n", __func__); else @@ -701,7 +701,7 @@ void cVideo::run(void) #else frame->best_effort_timestamp #endif - ); + ); } else hal_debug("%s: got_frame: %d stillpicture: %d\n", __func__, got_frame, stillpicture); diff --git a/libmipsbox/hardware_caps.c b/libmipsbox/hardware_caps.c index cabfd08..26e3d8d 100644 --- a/libmipsbox/hardware_caps.c +++ b/libmipsbox/hardware_caps.c @@ -29,10 +29,14 @@ hw_caps_t *get_hwcaps(void) memset(&caps, 0, sizeof(hw_caps_t)); caps.pip_devs = 0; - if (access("/dev/dvb/adapter0/video1", F_OK) != -1) caps.pip_devs = 1; - if (access("/dev/dvb/adapter0/video2", F_OK) != -1) caps.pip_devs = 2; - if (access("/dev/dvb/adapter0/video3", F_OK) != -1) caps.pip_devs = 3; - if (caps.pip_devs > 0) caps.can_pip = 1; + if (access("/dev/dvb/adapter0/video1", F_OK) != -1) + caps.pip_devs = 1; + if (access("/dev/dvb/adapter0/video2", F_OK) != -1) + caps.pip_devs = 2; + if (access("/dev/dvb/adapter0/video3", F_OK) != -1) + caps.pip_devs = 3; + if (caps.pip_devs > 0) + caps.can_pip = 1; #if BOXMODEL_VUDUO caps.has_CI = 2; diff --git a/libraspi/dmx.cpp b/libraspi/dmx.cpp index fe350b0..e266cb6 100644 --- a/libraspi/dmx.cpp +++ b/libraspi/dmx.cpp @@ -350,13 +350,16 @@ bool cDemux::sectionFilter(unsigned short _pid, const unsigned char *const filte if (debuglevel == 2) { fprintf(stderr, "filt: "); - for (int i = 0; i < DMX_FILTER_SIZE; i++)fprintf(stderr, "%02hhx ", s_flt.filter.filter[i]); + for (int i = 0; i < DMX_FILTER_SIZE; i++) + fprintf(stderr, "%02hhx ", s_flt.filter.filter[i]); fprintf(stderr, "\n"); fprintf(stderr, "mask: "); - for (int i = 0; i < DMX_FILTER_SIZE; i++)fprintf(stderr, "%02hhx ", s_flt.filter.mask[i]); + for (int i = 0; i < DMX_FILTER_SIZE; i++) + fprintf(stderr, "%02hhx ", s_flt.filter.mask[i]); fprintf(stderr, "\n"); fprintf(stderr, "mode: "); - for (int i = 0; i < DMX_FILTER_SIZE; i++)fprintf(stderr, "%02hhx ", s_flt.filter.mode[i]); + for (int i = 0; i < DMX_FILTER_SIZE; i++) + fprintf(stderr, "%02hhx ", s_flt.filter.mode[i]); fprintf(stderr, "\n"); } diff --git a/libraspi/glfb.cpp b/libraspi/glfb.cpp index 77237e1..9b5b51d 100644 --- a/libraspi/glfb.cpp +++ b/libraspi/glfb.cpp @@ -143,15 +143,15 @@ void GLFramebuffer::setup() vc_dispmanx_rect_set(&src_rect, 0, 0, width << 16, height << 16); vc_dispmanx_rect_set(&dsp_rect, 0, 0, info.width, info.height); element = vc_dispmanx_element_add(update, - display, - 2000 /*layer*/, - &dsp_rect, - res[curr_res], - &src_rect, - DISPMANX_PROTECTION_NONE, - &alpha, - NULL, - DISPMANX_NO_ROTATE); + display, + 2000 /*layer*/, + &dsp_rect, + res[curr_res], + &src_rect, + DISPMANX_PROTECTION_NONE, + &alpha, + NULL, + DISPMANX_NO_ROTATE); ret = vc_dispmanx_update_submit_sync(update); CHECK(ret == 0); curr_res = !curr_res;