Revision bd209760 chunker_player.c

View differences:

chunker_player.c
37 37

  
38 38
#define SDL_AUDIO_BUFFER_SIZE 1024
39 39

  
40
#define QUEUE_FILLING_THRESHOLD 500
40
#define QUEUE_FILLING_THRESHOLD 200
41 41
#define MAX_TOLLERANCE 40
42 42
#define AUDIO	1
43 43
#define VIDEO	2
44 44

  
45
#define DEBUG_AUDIO
46
#define DEBUG_VIDEO
47
#define DEBUG_QUEUE
48
#define DEBUG_SOURCE
49
#define DEBUG_ENQUEUE
50
#define DEBUG_STATS
51
#define DEBUG_AUDIO_BUFFER
52
#define DEBUG_ENQUEUE
45
//#define DEBUG_AUDIO
46
//#define DEBUG_VIDEO
47
//#define DEBUG_QUEUE
48
//#define DEBUG_SOURCE
49
//#define DEBUG_ENQUEUE
50
//#define DEBUG_STATS
51
//#define DEBUG_AUDIO_BUFFER
52
//#define DEBUG_ENQUEUE
53 53

  
54 54
short int QueueFillingMode=1;
55 55
short int QueueStopped=0;
......
102 102
	//q->cond = SDL_CreateCond();
103 103
	QueueFillingMode=1;
104 104
	q->queueType=Type;
105
	q->last_frame_extracted = 0;
105
	q->last_frame_extracted = 3;
106 106
	q->total_lost_frames = 0;
107 107
	q->first_pkt= NULL;
108 108
	//q->last_pkt = NULL;
......
137 137
#endif
138 138

  
139 139
	QueueFillingMode=1;
140
	q->last_frame_extracted = 0;
140
	q->last_frame_extracted = 3;
141 141
	q->total_lost_frames = 0;
142 142
	q->first_pkt= NULL;
143 143
	//q->last_pkt = NULL;
......
1136 1136
	int data_sizeQ;
1137 1137
	int lenQ;
1138 1138
	int sizeFrame = 0;
1139
	sizeFrame = 3*sizeof(int)+sizeof(struct timeval);
1139
	sizeFrame = 3*sizeof(int32_t)+sizeof(struct timeval);
1140 1140
#ifdef DEBUG_ENQUEUE
1141 1141
printf("O\n");
1142 1142
#endif
......
1200 1200
	j=echunk->payload_len;
1201 1201
	while(j>0 && !quit) {
1202 1202
		//usleep(30000);
1203
		frame->number = *((int *)tempdata);
1204
		tempdata+=sizeof(int);
1203
		frame->number = *((int32_t *)tempdata);
1204
		tempdata+=sizeof(int32_t);
1205 1205
		frame->timestamp = *((struct timeval *)tempdata);
1206 1206
		tempdata += sizeof(struct timeval);
1207
		frame->size = *((int *)tempdata);
1208
		tempdata+=sizeof(int);
1209
		frame->type = *((int *)tempdata);
1210
		tempdata+=sizeof(int);
1207
		frame->size = *((int32_t *)tempdata);
1208
		tempdata+=sizeof(int32_t);
1209
		frame->type = *((int32_t *)tempdata);
1210
		tempdata+=sizeof(int32_t);
1211 1211

  
1212 1212
		buffer = tempdata; // here coded frame information
1213 1213
		tempdata+=frame->size;

Also available in: Unified diff