Revision e5557dc3

View differences:

chunker_player/player_core.c
30 30
#include "player_core.h"
31 31
#include "player_stats.h"
32 32

  
33
static char *video_codec;
34

  
35 33
typedef struct PacketQueue {
36 34
	AVPacketList *first_pkt;
37 35
	AVPacket *minpts_pkt;
......
336 334

  
337 335
int ChunkerPlayerCore_InitCodecs(char *v_codec, int width, int height, char *audio_codec, int sample_rate, short int audio_channels)
338 336
{
339
	video_codec = v_codec;
340

  
341 337
	// some initializations
342 338
	QueueStopped = 0;
343 339
	AudioQueueOffset=0;
......
356 352
	
357 353
	VideoCallbackThreadParams.width = width;
358 354
	VideoCallbackThreadParams.height = height;
355
	VideoCallbackThreadParams.video_codec = strdup(v_codec);
359 356

  
360 357
	// Register all formats and codecs
361 358
	avcodec_init();
......
818 815
	//frecon = fopen("recondechunk.mpg","wb");
819 816

  
820 817
	//setup video decoder
821
	pCodec = avcodec_find_decoder_by_name(video_codec);
818
	pCodec = avcodec_find_decoder_by_name(tval->video_codec);
822 819
	if (pCodec) {
823 820
		fprintf(stderr, "INIT: Setting VIDEO codecID to: %d\n",pCodec->id);
824 821
	} else {
825
		fprintf(stderr, "INIT: Unknown VIDEO codec: %s!\n", video_codec);
822
		fprintf(stderr, "INIT: Unknown VIDEO codec: %s!\n", tval->video_codec);
826 823
		return -1; // Codec not found
827 824
	}
828 825

  
chunker_player/player_core.h
6 6
typedef struct threadVal {
7 7
	int width;
8 8
	int height;
9
	char *video_codec;
9 10
} ThreadVal;
10 11

  
11 12
int ChunkerPlayerCore_InitCodecs(char *v_codec, int width, int height, char *audio_codec, int sample_rate, short int audio_channels);

Also available in: Unified diff