Mercurial > pt1
comparison recpt1/tssplitter_lite.c @ 139:61ff9cabf962
fix for split buffer shortage
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Thu, 25 Apr 2013 15:08:35 +0900 |
parents | 550ee373afbc |
children | 1e7718cc2556 |
comparison
equal
deleted
inserted
replaced
138:45b4afa656d2 | 139:61ff9cabf962 |
---|---|
312 int result = TSS_SUCCESS; | 312 int result = TSS_SUCCESS; |
313 int pmts = 0; | 313 int pmts = 0; |
314 int version = 0; | 314 int version = 0; |
315 | 315 |
316 /* 初期化 */ | 316 /* 初期化 */ |
317 dbuf->size = 0; | 317 dbuf->buffer_filled = 0; |
318 if (sbuf->size < 0) { | 318 if (sbuf->size < 0) { |
319 return TSS_ERROR; | 319 return TSS_ERROR; |
320 } | 320 } |
321 | 321 |
322 sptr = sbuf->data; | 322 sptr = sbuf->data; |
340 } | 340 } |
341 splitter->pat[3] = splitter->pat_count; | 341 splitter->pat[3] = splitter->pat_count; |
342 | 342 |
343 memcpy(dptr + d_offset, splitter->pat, LENGTH_PACKET); | 343 memcpy(dptr + d_offset, splitter->pat, LENGTH_PACKET); |
344 d_offset += LENGTH_PACKET; | 344 d_offset += LENGTH_PACKET; |
345 dbuf->size += LENGTH_PACKET; | 345 dbuf->buffer_filled += LENGTH_PACKET; |
346 break; | 346 break; |
347 default: | 347 default: |
348 if(0 != splitter->pmt_pids[pid]) { | 348 if(0 != splitter->pmt_pids[pid]) { |
349 //PMT | 349 //PMT |
350 if ((sptr + s_offset)[1] & 0x40) { // PES開始インジケータ | 350 if ((sptr + s_offset)[1] & 0x40) { // PES開始インジケータ |
370 } | 370 } |
371 /* pids[pid] が 1 は残すパケットなので書き込む */ | 371 /* pids[pid] が 1 は残すパケットなので書き込む */ |
372 if(0 != splitter->pids[pid]) { | 372 if(0 != splitter->pids[pid]) { |
373 memcpy(dptr + d_offset, sptr + s_offset, LENGTH_PACKET); | 373 memcpy(dptr + d_offset, sptr + s_offset, LENGTH_PACKET); |
374 d_offset += LENGTH_PACKET; | 374 d_offset += LENGTH_PACKET; |
375 dbuf->size += LENGTH_PACKET; | 375 dbuf->buffer_filled += LENGTH_PACKET; |
376 } | 376 } |
377 break; | 377 break; |
378 } /* switch */ | 378 } /* switch */ |
379 | 379 |
380 s_offset += LENGTH_PACKET; | 380 s_offset += LENGTH_PACKET; |