Advertisement
Guest User

Untitled

a guest
Sep 7th, 2014
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.29 KB | None | 0 0
  1. --- a/arib_std_b25.c    Sun Oct 21 19:38:02 2012 +0900
  2. +++ b/arib_std_b25.c    Mon Sep 08 06:47:52 2014 +0900
  3. @@ -1277,7 +1277,44 @@
  4.         }
  5.        
  6.         extract_ts_header(&hdr, curr);
  7. -      
  8. +
  9. +       if(hdr.pid == 0x0000){
  10. +           p = curr+4;
  11. +           if(hdr.adaptation_field_control & 0x02){
  12. +               p += (p[0]+1);
  13. +           }
  14. +           size = 188 - (p-curr);
  15. +           if(size < 1){
  16. +               goto NEXT;
  17. +           }
  18. +           if(prv->pat == NULL){
  19. +               prv->pat = create_ts_section_parser();
  20. +               if(prv->pat == NULL){
  21. +                   r = ARIB_STD_B25_ERROR_NO_ENOUGH_MEMORY;
  22. +                   goto LAST;
  23. +               }
  24. +           }
  25. +           n = prv->pat->put(prv->pat, &hdr, p, size);
  26. +           if(n < 0){
  27. +               r = ARIB_STD_B25_ERROR_PAT_PARSE_FAILURE;
  28. +               curr += unit;
  29. +               goto LAST;
  30. +           }
  31. +           n = prv->pat->get_count(prv->pat);
  32. +           if(n < 0){
  33. +               r = ARIB_STD_B25_ERROR_PAT_PARSE_FAILURE;
  34. +               curr += unit;
  35. +               goto LAST;
  36. +           }
  37. +           if(n == 0){
  38. +               goto NEXT;
  39. +           }
  40. +           r = proc_pat(prv);
  41. +           curr += unit;
  42. +           prv->sbuf.head = curr;
  43. +           goto LAST;
  44. +       }
  45. +
  46.         if(prv->map[hdr.pid].type != PID_MAP_TYPE_PMT){
  47.             goto NEXT;
  48.         }
  49. @@ -1607,6 +1644,44 @@
  50.             curr = p;
  51.         }
  52.         extract_ts_header(&hdr, curr);
  53. +
  54. +       if(hdr.pid == 0x0000){
  55. +           p = curr+4;
  56. +           if(hdr.adaptation_field_control & 0x02){
  57. +               p += (p[0]+1);
  58. +           }
  59. +           size = 188 - (p-curr);
  60. +           if(size < 1){
  61. +               goto NEXT;
  62. +           }
  63. +           if(prv->pat == NULL){
  64. +               prv->pat = create_ts_section_parser();
  65. +               if(prv->pat == NULL){
  66. +                   r = ARIB_STD_B25_ERROR_NO_ENOUGH_MEMORY;
  67. +                   goto LAST;
  68. +               }
  69. +           }
  70. +           n = prv->pat->put(prv->pat, &hdr, p, size);
  71. +           if(n < 0){
  72. +               r = ARIB_STD_B25_ERROR_PAT_PARSE_FAILURE;
  73. +               curr += unit;
  74. +               goto LAST;
  75. +           }
  76. +           n = prv->pat->get_count(prv->pat);
  77. +           if(n < 0){
  78. +               r = ARIB_STD_B25_ERROR_PAT_PARSE_FAILURE;
  79. +               curr += unit;
  80. +               goto LAST;
  81. +           }
  82. +           if(n == 0){
  83. +               goto NEXT;
  84. +           }
  85. +           r = proc_pat(prv);
  86. +           curr += unit;
  87. +           prv->sbuf.head = curr;
  88. +           goto LAST;
  89. +       }
  90. +
  91.         if(prv->map[hdr.pid].type != PID_MAP_TYPE_ECM){
  92.             goto NEXT;
  93.         }
  94. @@ -2052,6 +2127,7 @@
  95.                 goto NEXT;
  96.             }
  97.             r = proc_pat(prv);
  98. +           curr += unit;
  99.             goto LAST;
  100.         }
  101.            
  102. @@ -2060,7 +2136,7 @@
  103.     }
  104.  
  105.  LAST:
  106. -   m = curr - prv->sbuf.head;
  107. +   m = curr - prv->sbuf.pool;
  108.     n = tail - curr;
  109.     if( (n < 1024) || (m > (prv->sbuf.max/2) ) ){
  110.         p = prv->sbuf.pool;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement