comparison src/recpt1.c @ 172:89e24a1c8a64

Fix problem: If boot argument channel had selected by DLNA. Stream will interrupted.
author Naoya OYAMA <naoya.oyama@gmail.com>
date Mon, 29 Oct 2012 22:25:59 +0900
parents 4f3640bf350d
children 03ab3ade9fe5
comparison
equal deleted inserted replaced
171:6c710e5a28b8 172:89e24a1c8a64
154 int recsec = 0, time_to_add = 0; 154 int recsec = 0, time_to_add = 0;
155 int current_type; 155 int current_type;
156 splitter *splitter = tdata->splitter; 156 splitter *splitter = tdata->splitter;
157 boolean use_splitter = splitter ? TRUE : FALSE; 157 boolean use_splitter = splitter ? TRUE : FALSE;
158 boolean use_dlna = tdata->streamer ? TRUE : FALSE; 158 boolean use_dlna = tdata->streamer ? TRUE : FALSE;
159 boolean stop_rec = FALSE;
159 ISDB_T_FREQ_CONV_TABLE *table = NULL; 160 ISDB_T_FREQ_CONV_TABLE *table = NULL;
160 161
161 while(1) { 162 while(1) {
162 if(msgrcv(tdata->msqid, &rbuf, MSGSZ, 1, 0) < 0) { 163 if(msgrcv(tdata->msqid, &rbuf, MSGSZ, 1, 0) < 0) {
163 return NULL; 164 return NULL;
187 } 188 }
188 tdata->table = table; 189 tdata->table = table;
189 190
190 /* stop stream */ 191 /* stop stream */
191 ioctl(tdata->tfd, STOP_REC, 0); 192 ioctl(tdata->tfd, STOP_REC, 0);
193 stop_rec = TRUE;
192 194
193 /* wait for remainder */ 195 /* wait for remainder */
194 while(tdata->queue->num_used > 0) { 196 while(tdata->queue->num_used > 0) {
195 usleep(10000); 197 usleep(10000);
196 } 198 }
232 time(&splitter->split_start_time); 234 time(&splitter->split_start_time);
233 strncpy(tdata->sid_list, sid_list, sizeof(tdata->sid_list)); 235 strncpy(tdata->sid_list, sid_list, sizeof(tdata->sid_list));
234 pthread_mutex_unlock(&tdata->splitter_mutex); 236 pthread_mutex_unlock(&tdata->splitter_mutex);
235 } 237 }
236 238
237 if (strcmp(tdata->ch, channel)) { 239 if (stop_rec) {
238 if (tdata->table->type != current_type) { 240 if (tdata->table->type != current_type) {
239 /* re-open device */ 241 /* re-open device */
240 if(close_tuner(tdata) != 0) 242 if(close_tuner(tdata) != 0)
241 return NULL; 243 return NULL;
242 244