comparison src/recpt1.c @ 141:519a035533f6

Fix DLNA streaming issue.
author Naoya OYAMA <naoya.oyama@gmail.com>
date Sun, 29 Jul 2012 18:43:46 +0900
parents c4e0a5777363
children d65c15276b5e
comparison
equal deleted inserted replaced
140:faa0bc5fc2f5 141:519a035533f6
347 pthread_cond_signal(&p_queue->cond_avail); 347 pthread_cond_signal(&p_queue->cond_avail);
348 348
349 return buffer; 349 return buffer;
350 } 350 }
351 351
352 #define QUQUE_LOW_MIN (100)
353 #define QUEUE_LOW_USLEEP (800*1000)
354 ARIB_STD_B25_BUFFER * 352 ARIB_STD_B25_BUFFER *
355 stream_dequeue(STREAM_QUEUE_T *p_queue) 353 stream_dequeue(STREAM_QUEUE_T *p_queue)
356 { 354 {
357 struct timeval now; 355 struct timeval now;
358 struct timespec spec; 356 struct timespec spec;
388 386
389 /* leaving the critical section */ 387 /* leaving the critical section */
390 pthread_mutex_unlock(&p_queue->mutex); 388 pthread_mutex_unlock(&p_queue->mutex);
391 pthread_cond_signal(&p_queue->cond_avail); 389 pthread_cond_signal(&p_queue->cond_avail);
392 390
393 if ( p_queue->num_used < QUQUE_LOW_MIN ) {
394 /* force sleep 800msec */
395 usleep(QUEUE_LOW_USLEEP);
396 }
397 return buffer; 391 return buffer;
398 } 392 }
399 393
400 /* this function will be reader thread */ 394 /* this function will be reader thread */
401 void * 395 void *