Revision 71fa7249

View differences:

chunker_player/chunker_player.c
27 27
#include <windows.h>
28 28
#endif
29 29

  
30
static char *audio_codec = "mp2";
31
static char *video_codec = "mpeg4";
32

  
33 30
int ReadALine(FILE* fp, char* Output, int MaxOutputSize)
34 31
{
35 32
    int i=0;
......
145 142
	OverlayMutex = SDL_CreateMutex();
146 143
	
147 144
	char c;
148
	while ((c = getopt (argc, argv, "q:c:p:A:V:s:t")) != -1)
145
	while ((c = getopt (argc, argv, "q:c:p:s:t")) != -1)
149 146
	{
150 147
		switch (c) {
151 148
			case 0: //for long options
......
159 156
			case 'p':
160 157
				sscanf(optarg, "%d", &Port);
161 158
				break;
162
			case 'A':
163
				audio_codec = strdup(optarg);
164
				break;
165
			case 'V':
166
				video_codec = strdup(optarg);
167
				break;
168 159
			case 's':
169 160
				sscanf(optarg, "%d", &SilentMode);
170 161
				break;
......
472 463
		CFG_INT("Width", 176, CFGF_NONE),
473 464
		CFG_INT("Height", 144, CFGF_NONE),
474 465
		CFG_INT("Bitrate", 0, CFGF_NONE),
466
		CFG_STR("VideoCodec", "mpeg4", CFGF_NONE),
467
		CFG_STR("AudioCodec", "mp3", CFGF_NONE),
475 468
		
476 469
		// for some reason libconfuse parsing for floating point does not work in windows
477 470
		//~ CFG_FLOAT("Ratio", 1.22, CFGF_NONE),
......
524 517
		cfg_channel = cfg_getnsec(cfg, "Channel", j);
525 518
		sprintf(Channels[j].Title, "%s", cfg_title(cfg_channel));
526 519
		strcpy(Channels[j].LaunchString, cfg_getstr(cfg_channel, "LaunchString"));
520
		strcpy(Channels[j].VideoCodec, cfg_getstr(cfg_channel, "VideoCodec"));
521
		strcpy(Channels[j].AudioCodec, cfg_getstr(cfg_channel, "AudioCodec"));
527 522
		Channels[j].Width = cfg_getint(cfg_channel, "Width");
528 523
		Channels[j].Height = cfg_getint(cfg_channel, "Height");
529 524
		Channels[j].AudioChannels = cfg_getint(cfg_channel, "AudioChannels");
......
577 572
	ChunkerPlayerCore_SetupOverlay(w, h);
578 573
	//ChunkerPlayerGUI_SetupOverlayRect(channel);
579 574
	
580
	if(ChunkerPlayerCore_InitCodecs(video_codec, channel->Width, channel->Height, audio_codec, channel->SampleRate, channel->AudioChannels) < 0)
575
	if(ChunkerPlayerCore_InitCodecs(channel->VideoCodec, channel->Width, channel->Height, channel->AudioCodec, channel->SampleRate, channel->AudioChannels) < 0)
581 576
	{
582 577
		printf("ERROR, COULD NOT INITIALIZE CODECS\n");
583 578
		exit(2);
chunker_player/chunker_player.h
27 27
	int history_index;
28 28
	char quality[255];
29 29
	int startTime;
30
	char VideoCodec[255];
31
	char AudioCodec[255];
30 32
} SChannel;
31 33

  
32 34
SDL_mutex *OverlayMutex;

Also available in: Unified diff