Mercurial > pt1.oyama
comparison src/recpt1.c @ 149:a9f60d56d673
Fix DLNA problem
author | Naoya OYAMA <naoya.oyama@gmail.com> |
---|---|
date | Sat, 25 Aug 2012 11:10:24 +0900 |
parents | 066f33b2213a |
children | f7f594bf4e98 |
comparison
equal
deleted
inserted
replaced
148:da6ea0ef68ff | 149:a9f60d56d673 |
---|---|
521 * 2.2.3.1 enqueue() $B$O(B tdata->stream_queue->mutex $B$r(B lock/unlock $B$7$F=q$-9~$_;~$NF1;~99?7$rKI;_$7$F$$$k(B | 521 * 2.2.3.1 enqueue() $B$O(B tdata->stream_queue->mutex $B$r(B lock/unlock $B$7$F=q$-9~$_;~$NF1;~99?7$rKI;_$7$F$$$k(B |
522 */ | 522 */ |
523 /* | 523 /* |
524 * DLNA $B$G$N(BSID$BJQ99$N<BAu<B83(B | 524 * DLNA $B$G$N(BSID$BJQ99$N<BAu<B83(B |
525 */ | 525 */ |
526 if ( use_dlna && buf.size > 0 ) { | 526 if ( use_dlna && buf.size > 0 && |
527 strcmp("all", ut->request_channel)) { | |
527 if ( use_splitter ) { | 528 if ( use_splitter ) { |
528 new_sid = atoi(ut->request_channel); | 529 new_sid = atoi(ut->request_channel); |
529 if ( old_sid != new_sid ) { | 530 if ( old_sid != new_sid ) { |
530 old_sid = new_sid; | 531 old_sid = new_sid; |
531 split_shutdown(splitter); | 532 split_shutdown(splitter); |
535 use_splitter = FALSE; | 536 use_splitter = FALSE; |
536 } | 537 } |
537 split_select_finish = TSS_ERROR; | 538 split_select_finish = TSS_ERROR; |
538 free(qbuf); | 539 free(qbuf); |
539 qbuf = NULL; | 540 qbuf = NULL; |
541 | |
542 pthread_mutex_lock(&data->stream_queue->mutex); | |
543 while(1) { | |
544 STREAM_QUEUE_T *p_queue = data->stream_queue; | |
545 if (p_queue->num_used == 0) | |
546 break; | |
547 free(p_queue->buffer[p_queue->out]->data); | |
548 p_queue->buffer[p_queue->out]->data = NULL; | |
549 free(p_queue->buffer[p_queue->out]); | |
550 p_queue->buffer[p_queue->out] = NULL; | |
551 p_queue->out++; | |
552 p_queue->out %= p_queue->size; | |
553 | |
554 /* update counters */ | |
555 p_queue->num_avail++; | |
556 p_queue->num_used--; | |
557 } | |
558 pthread_mutex_unlock(&data->stream_queue->mutex); | |
559 fprintf (stderr, "reader_func() free stream queue finish.\n"); | |
540 time(&split_start_time); | 560 time(&split_start_time); |
541 continue; | 561 continue; |
542 } | 562 } |
543 } | 563 } |
544 do { | 564 do { |