Revision 4d977f7d chunker_player.c
chunker_player.c | ||
---|---|---|
253 | 253 |
q->density = (double)q->nb_packets / (double)(q->last_pkt->pkt.stream_index - q->first_pkt->pkt.stream_index) * 100.0; |
254 | 254 |
|
255 | 255 |
#ifdef DEBUG_STATS |
256 |
printf("STATS: queue type %d f %d l %d density %f\n", q->queueType, q->first_pkt->pkt.stream_index, q->last_pkt->pkt.stream_index, q->density); |
|
256 |
if(q->queueType == AUDIO) |
|
257 |
printf("STATS: AUDIO QUEUE DENSITY percentage %f\n", q->density); |
|
258 |
if(q->queueType == VIDEO) |
|
259 |
printf("STATS: VIDEO QUEUE DENSITY percentage %f\n", q->density); |
|
257 | 260 |
#endif |
258 | 261 |
|
259 | 262 |
SDL_UnlockMutex(q->mutex); |
... | ... | |
346 | 349 |
} |
347 | 350 |
|
348 | 351 |
void update_queue_stats(PacketQueue *q, int packet_index) { |
352 |
double percentage = 0.0; |
|
349 | 353 |
//compute lost frame statistics |
350 | 354 |
if(q->last_frame_extracted > 0 && packet_index > q->last_frame_extracted) { |
351 | 355 |
q->total_lost_frames = q->total_lost_frames + packet_index - q->last_frame_extracted - 1; |
356 |
percentage = (double)q->total_lost_frames / (double)q->last_frame_extracted * 100.0; |
|
352 | 357 |
#ifdef DEBUG_STATS |
353 |
printf(" STATS QUEUE stats: stidx %d last %d tot %d\n", packet_index, q->last_frame_extracted, q->total_lost_frames); |
|
358 |
if(q->queueType == AUDIO) |
|
359 |
printf("STATS: AUDIO FRAMES LOST: total %d percentage %f\n", q->total_lost_frames, percentage); |
|
360 |
else if(q->queueType == VIDEO) |
|
361 |
printf("STATS: VIDEO FRAMES LOST: total %d percentage %f\n", q->total_lost_frames, percentage); |
|
354 | 362 |
#endif |
355 | 363 |
} |
356 | 364 |
} |
Also available in: Unified diff