From b66325f0959381acfd69eb1fe46bfd9c21cd05c2 Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Sun, 4 Jan 2015 13:05:38 -0800 Subject: [PATCH] revert 12fe67a367e459cdc79340bff03732158336feb4 implement nosound without overriding mysterious track parameter --- libmve/mve_main.c | 13 ++++++------- libmve/mveplay.c | 2 +- main/movie.c | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/libmve/mve_main.c b/libmve/mve_main.c index 84ca6188..16aa5813 100644 --- a/libmve/mve_main.c +++ b/libmve/mve_main.c @@ -22,7 +22,7 @@ static SDL_Surface *real_screen; #endif static unsigned char g_palette[768]; static int g_truecolor; -static int track; +static int nosound = 0; static int doPlay(const char *filename); @@ -38,13 +38,12 @@ int main(int c, char **v) usage(); if (!strcmp(v[1], "-nosound")) { - track = 0; + nosound = 1; c--; v++; - } else - track = 1; + } - if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) + if (SDL_Init( SDL_INIT_VIDEO | (nosound ? 0 : SDL_INIT_AUDIO) ) < 0) { fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError()); exit(1); @@ -227,13 +226,13 @@ static int doPlay(const char *filename) memset(g_palette, 0, 768); - MVE_sndInit(1); + MVE_sndInit( nosound ? -1 : 1 ); MVE_memCallbacks((mve_cb_Alloc)malloc, free); MVE_ioCallbacks(fileRead); MVE_sfCallbacks(showFrame); MVE_palCallbacks(setPalette); - MVE_rmPrepMovie(mve, -1, -1, track); + MVE_rmPrepMovie(mve, -1, -1, 1); MVE_getVideoSpec(&vSpec); diff --git a/libmve/mveplay.c b/libmve/mveplay.c index f79a4efb..4bce32d9 100644 --- a/libmve/mveplay.c +++ b/libmve/mveplay.c @@ -675,7 +675,7 @@ int MVE_rmPrepMovie(void *src, int x, int y, int track) mve_set_handler(mve, MVE_OPCODE_VIDEODATA, video_data_handler); mve_play_next_chunk(mve); /* video initialization chunk */ - if (track) + if (mve_audio_enabled) mve_play_next_chunk(mve); /* audio initialization chunk */ return 0; diff --git a/main/movie.c b/main/movie.c index 3b77b2ba..d272239c 100644 --- a/main/movie.c +++ b/main/movie.c @@ -277,7 +277,7 @@ int RunMovie(char *filename, int hires_flag, int must_have,int dx,int dy) { SDL_RWops *filehndl; int result=1,aborted=0; - int track = 1; + int track = 0; int frame_num; int key; -- 2.39.2