Revision 0cd6b05d chunker_player/chunker_player.c

View differences:

chunker_player/chunker_player.c
17 17
#include "player_gui.h"
18 18
#include <time.h>
19 19
#include <getopt.h>
20
#include <napa_log.h>
20 21

  
21 22
#define MANDATORY_PARAMS 3
22 23
#define OPTIONAL_PARAMS 1
......
44 45
    return -1;
45 46
}
46 47

  
48
void CheckForRepoAddress(char* Param)
49
{
50
    char* pch;
51
    if(strncasecmp(Param,"repo_address=",13)==0)
52
    {
53
        pch=strtok(Param+13,",");
54
        strncpy(RepoAddress,pch,2048);
55
    }
56
}
57

  
47 58
void sigproc()
48 59
{
49 60
	printf("you have pressed ctrl-c, terminating...\n");
......
75 86
	quit = 0;
76 87
	QueueFillingMode=1;
77 88
	LogTraces = 0;
89
	repoclient=NULL;
90
	LastTimeRepoPublish.tv_sec=0;
91
	LastTimeRepoPublish.tv_usec=0;
92
	
93
	napaInitLog(LOG_DEBUG, NULL, NULL);
94
    repInit("");
78 95

  
96
	
79 97
#ifndef __WIN32__
80 98
	static pid_t fork_pid = -1;
81 99
	P2PProcessHandle=&fork_pid;
......
559 577

  
560 578
		printf("OFFERSTREAMER LAUNCH STRING: %s %s\n", argv0, parameters_string);
561 579

  
562
#ifndef __WIN32__
580

  
563 581
		char* parameters_vector[255];
564 582
		parameters_vector[0] = argv0;
565 583
		
......
572 590
			// printf ("\tpch=%s\n",pch);
573 591
			parameters_vector[par_count] = (char*) malloc(sizeof(char)*(strlen(pch)+1));
574 592
			strcpy(parameters_vector[par_count], pch);
593
			// Find repo_address
594
			CheckForRepoAddress(parameters_vector[par_count]);
575 595
			pch = strtok (NULL, " ");
576 596
			par_count++;
577 597
		}
578 598
		parameters_vector[par_count] = NULL;
579

  
599
		
600
#ifndef __WIN32__
580 601
		int d;
581 602
		int stdoutS, stderrS;
582 603
		FILE* stream;
......
654 675
		}
655 676
#endif
656 677

  
678
        // Open Repository
679
        if(repoclient) repClose(repoclient);
680
        repoclient=NULL;
681
	    
682
	    repoclient = repOpen(RepoAddress,0);
683
	    //if (repoclient == NULL) fatal("Unable to initialize repoclient");
657 684
	}
658 685
	// Read the Network ID
659 686
	int Error=true;

Also available in: Unified diff