diff 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
line wrap: on
line diff
--- a/src/recpt1.c	Sun Oct 03 11:35:19 2010 +0900
+++ b/src/recpt1.c	Sun Oct 03 21:55:37 2010 +0900
@@ -674,6 +674,8 @@
     //fprintf (stderr, "stream_func(): start.\n");
 
     while(1) {
+        if(f_exit)
+            break;
         // 3.1 tdata->stream_queue $B$+$i(B dequeue $B$9$k(B
         // dequeue $B$7$?%G!<%?$O(B ARIB_STD_B25_BUFFER
         qbuf = stream_dequeue(p_queue);
@@ -871,11 +873,15 @@
 void
 cleanup(thread_data *tdata)
 {
+    int use_dlna = TRUE;
     /* stop recording */
     ioctl(tdata->tfd, STOP_REC, 0);
 
     /* xxx need mutex? */
     f_exit = TRUE;
+    if ( use_dlna ) {
+        UPnPBreak(0);
+    }
 
     pthread_cond_signal(&tdata->queue->cond_avail);
     pthread_cond_signal(&tdata->queue->cond_used);