comparison src/recpt1.c @ 126:5dcaf3785ebe

fix process terminate problem. add dynamic Content-Length header.
author Naoya OYAMA <naoya.oyama@gmail.com>
date Sun, 03 Oct 2010 21:55:37 +0900
parents e413158cae13
children 5a380559a61e
comparison
equal deleted inserted replaced
125:e413158cae13 126:5dcaf3785ebe
672 ARIB_STD_B25_BUFFER *buf; 672 ARIB_STD_B25_BUFFER *buf;
673 int i; 673 int i;
674 //fprintf (stderr, "stream_func(): start.\n"); 674 //fprintf (stderr, "stream_func(): start.\n");
675 675
676 while(1) { 676 while(1) {
677 if(f_exit)
678 break;
677 // 3.1 tdata->stream_queue $B$+$i(B dequeue $B$9$k(B 679 // 3.1 tdata->stream_queue $B$+$i(B dequeue $B$9$k(B
678 // dequeue $B$7$?%G!<%?$O(B ARIB_STD_B25_BUFFER 680 // dequeue $B$7$?%G!<%?$O(B ARIB_STD_B25_BUFFER
679 qbuf = stream_dequeue(p_queue); 681 qbuf = stream_dequeue(p_queue);
680 /* no entry in the queue */ 682 /* no entry in the queue */
681 if(qbuf == NULL) { 683 if(qbuf == NULL) {
869 } 871 }
870 872
871 void 873 void
872 cleanup(thread_data *tdata) 874 cleanup(thread_data *tdata)
873 { 875 {
876 int use_dlna = TRUE;
874 /* stop recording */ 877 /* stop recording */
875 ioctl(tdata->tfd, STOP_REC, 0); 878 ioctl(tdata->tfd, STOP_REC, 0);
876 879
877 /* xxx need mutex? */ 880 /* xxx need mutex? */
878 f_exit = TRUE; 881 f_exit = TRUE;
882 if ( use_dlna ) {
883 UPnPBreak(0);
884 }
879 885
880 pthread_cond_signal(&tdata->queue->cond_avail); 886 pthread_cond_signal(&tdata->queue->cond_avail);
881 pthread_cond_signal(&tdata->queue->cond_used); 887 pthread_cond_signal(&tdata->queue->cond_used);
882 } 888 }
883 889