Skip to content

Commit a280b7f

Browse files
author
molivier
committed
Compilation fixes for dpvencode and dpvplayer. Also, fixed a crash when the video doesn't have an associated sound file
git-svn-id: svn://svn.icculus.org/twilight/trunk/dpvideo@4252 d7cf8633-e32d-0410-b094-e92efae38249
1 parent 9b8b3e0 commit a280b7f

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

dpvencode.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ int dpvencode_error(void *stream, char **errorstring);
2525
// retrieves a string describing any error number the encoder can produce
2626
char *dpvencode_errorstring(int errornum);
2727

28-
#endif
28+
#endif

dpvplayer.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
#include <stdlib.h>
33
#include <stdio.h>
4+
#include <string.h>
45
#include "dpvdecode.h"
56
#include "SDL.h"
67
#include "SDL_main.h"
@@ -502,7 +503,7 @@ static void dpvplayer(char *filename, void *stream, int fullscreen, int opengl,
502503
desiredaudiospec = malloc(sizeof(SDL_AudioSpec));
503504
memset(desiredaudiospec, 0, sizeof(SDL_AudioSpec));
504505

505-
desiredaudiospec->freq = soundfrequency;
506+
desiredaudiospec->freq = soundfrequency ? soundfrequency : 11025;
506507
desiredaudiospec->format = AUDIO_S16SYS;
507508
desiredaudiospec->channels = 2;
508509
desiredaudiospec->samples = 1024;//16384;//1024;//16384;//2048;

makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ PROFILEOPTION=
99
#this is used to ensure that all released versions are free of warnings.
1010

1111
#normal compile
12-
OPTIMIZATIONS= -O6 -fexpensive-optimizations
12+
OPTIMIZATIONS= -O6 -fexpensive-optimizations -fno-strict-aliasing
1313
CFLAGS= -I/usr/include/SDL -MD -Wall -Werror $(OPTIMIZATIONS) $(PROFILEOPTION)
1414
#debug compile
1515
#OPTIMIZATIONS=
16-
#CFLAGS= -MD -Wall -Werror -ggdb $(OPTIMIZATIONS) $(PROFILEOPTION)
16+
#CFLAGS= -I/usr/include/SDL -MD -Wall -Werror -ggdb $(OPTIMIZATIONS) $(PROFILEOPTION)
1717

1818
LDFLAGS= -lm $(PROFILEOPTION)
1919

0 commit comments

Comments
 (0)