Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -r aeeca29707aa -r cbc8d6f3f779 BonDriverProxy.cpp
- --- a/BonDriverProxy.cpp Tue Sep 02 17:10:53 2014 +0900
- +++ b/BonDriverProxy.cpp Tue Sep 02 23:22:36 2014 +0900
- @@ -10,7 +10,6 @@
- static std::list<cProxyServer *> InstanceList;
- static cCriticalSection Lock_Instance;
- -static B_CAS_CARD *g_bcas = 0;
- static int g_b25_round = 4;
- static int g_b25_enable = 0;
- static int g_b25_strip = 0;
- @@ -59,17 +58,6 @@
- if (ac > 4)
- g_TsPacketBufSize = ::atoi(av[4]);
- }
- -
- - if (g_b25_enable)
- - {
- - g_bcas = create_b_cas_card();
- - if (g_bcas) {
- - if (g_bcas->init(g_bcas) < 0) {
- - g_bcas->release(g_bcas);
- - g_bcas = 0;
- - }
- - }
- - }
- return 0;
- }
- @@ -790,13 +778,33 @@
- ts.tv_sec = 0;
- ts.tv_nsec = WAIT_TIME * 1000 * 1000;
- + B_CAS_CARD *bcas = 0;
- ARIB_STD_B25 *b25 = 0;
- - if (g_bcas)
- + if (g_b25_enable)
- + {
- + bcas = create_b_cas_card();
- + if (bcas)
- + {
- + if (bcas->init(g_bcas) < 0)
- + {
- + fprintf(stderr, "bcas::init() failed\n");
- + bcas->release(bcas);
- + bcas = 0;
- + }
- + }
- + else
- + {
- + fprintf(stderr, "bcas::create_b_cas_card failed\n");
- + }
- + }
- + if (bcas)
- {
- if ((b25 = create_arib_std_b25()) != 0)
- {
- - if (b25->set_b_cas_card(b25, g_bcas) < 0)
- + int code;
- + if ((code = b25->set_b_cas_card(b25, bcas)) < 0)
- {
- + fprintf(stderr, "b25::set_b_cas_card failed. (%d)\n", code);
- b25->release(b25);
- b25 = 0;
- }
- @@ -807,6 +815,10 @@
- b25->set_multi2_round(b25, g_b25_round);
- }
- }
- + else
- + {
- + fprintf(stderr, "b25::create_arib_std_b25 failed.\n");
- + }
- }
- // TS読み込みループ
- @@ -829,8 +841,19 @@
- {
- buf.data = pBuf;
- buf.size = dwSize;
- - b25->put(b25, &buf);
- - b25->get(b25, &buf);
- + int code;
- + if ((code = b25->put(b25, &buf)) < 0)
- + {
- + fprintf(stderr, "b25::put (%d)\n", code);
- + b25->reset(b25);
- + continue;
- + }
- + if ((code = b25->get(b25, &buf)) < 0)
- + {
- + fprintf(stderr, "b25::get (%d)\n", code);
- + b25->reset(b25);
- + continue;
- + }
- if (buf.size == 0)
- continue;
- }
- @@ -886,6 +909,8 @@
- }
- if (b25)
- b25->release(b25);
- + if (bcas)
- + bcas->release(bcas);
- delete[] pTsBuf;
- return NULL;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement