Revision a0e0d6ff

View differences:

build_ul.sh
349 349
		make clean
350 350
	else
351 351
		#get and compile libmicrohttpd lib
352
		svn --non-interactive checkout https://ng.gnunet.org/svn/libmicrohttpd
352
		svn --non-interactive --trust-server-cert checkout https://ng.gnunet.org/svn/libmicrohttpd
353 353
		cd libmicrohttpd
354 354
	fi
355 355
	
chunker_player/channels.conf
20 20
   Ratio = 1.4
21 21
}
22 22

  
23
Channel TN-TV3
23
Channel TORINO-TV3
24 24
{
25
	LaunchString = "-c 5 -b 200 -o 200 -i 130.192.86.31 -p 6666 -n repo_address=130.192.86.30:9832"
25
	LaunchString = "-c 1 -b 200 -o 200 -i 130.192.86.31 -p 6666 -n repo_address=130.192.86.30:9832"
26 26
	AudioChannels = 2
27 27
	SampleRate = 48000
28 28
	Width = 704
29 29
	Height = 576
30
	Ratio = 1.22
30
	Ratio = 1.33
31 31
}
32 32

  
33
Channel CT_Local_TV
33
Channel TORINO-TV4
34 34
{
35
	LaunchString = "-c 5 -b 200 -o 200 -i 127.0.0.1 -p 6666 -I lo -n repo_address=130.192.86.30:9832"
35
	LaunchString = "-c 1 -b 200 -o 200 -i 130.192.86.31 -p 6104 -n repo_address=130.192.86.30:9832"
36 36
	AudioChannels = 2
37 37
	SampleRate = 48000
38
	Width = 704
39
	Height = 576
40
	Ratio = 1
38
	Width = 854
39
	Height = 480
40
	Ratio = 1.78
41 41
}
chunker_player/player_core.c
246 246
	printf("using audio Codecid: %d ",aCodecCtx->codec_id);
247 247
	printf("samplerate: %d ",aCodecCtx->sample_rate);
248 248
	printf("channels: %d\n",aCodecCtx->channels);
249
	wanted_spec.freq = aCodecCtx->sample_rate;
249
	CurrentAudioFreq = wanted_spec.freq = aCodecCtx->sample_rate;
250 250
	wanted_spec.format = AUDIO_S16SYS;
251 251
	wanted_spec.channels = aCodecCtx->channels;
252 252
	wanted_spec.silence = 0;
253
	wanted_spec.samples = SDL_AUDIO_BUFFER_SIZE;
253
	CurrentAudioSamples = wanted_spec.samples = SDL_AUDIO_BUFFER_SIZE;
254 254
	wanted_spec.callback = AudioCallback;
255 255
	wanted_spec.userdata = aCodecCtx;
256 256
	if(SDL_OpenAudio(&wanted_spec,&AudioSpecification)<0)
257 257
	{
258
		fprintf(stderr,"SDL_OpenAudio: %s\n",SDL_GetError());
258
		fprintf(stderr,"SDL_OpenAudio: %s\n", SDL_GetError());
259 259
		return -1;
260 260
	}
261 261
	dimAudioQ = AudioSpecification.size;
......
1294 1294
	
1295 1295
	// Stop audio&video playback
1296 1296
	SDL_WaitThread(video_thread, NULL);
1297
	SDL_PauseAudio(1);
1297
	SDL_PauseAudio(1);	
1298 1298
	SDL_CloseAudio();
1299 1299
	
1300 1300
	if(YUVOverlay != NULL)
......
1311 1311
	free(VideoPkt.data);
1312 1312
	free(outbuf_audio);
1313 1313
	free(InitRect);
1314
	
1315
	/*
1316
	* Sleep two buffers' worth of audio before closing, in order
1317
	*  to allow the playback to finish. This isn't always enough;
1318
	*   perhaps SDL needs a way to explicitly wait for device drain?
1319
	*/
1320
	int delay = 2 * 1000 * CurrentAudioSamples / CurrentAudioFreq;
1321
	printf("SDL_Delay(%d)\n", delay);
1322
	SDL_Delay(delay);
1314 1323
}
1315 1324

  
1316 1325
int ChunkerPlayerCore_AudioEnded()
chunker_player/player_core.h
67 67
PacketQueue videoq;
68 68
AVPacket AudioPkt, VideoPkt;
69 69
int AVPlaying;
70
int CurrentAudioFreq;
71
int CurrentAudioSamples;
70 72

  
71 73
SDL_Rect *InitRect;
72 74
SDL_AudioSpec AudioSpecification;

Also available in: Unified diff