mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-09-28 01:48:04 +03:00
Fix a bug that bgm did not work after movie load failed
When movie_free() was called in movie_load(), mixer_stream_stop(0) was mistakenly called and the music mixer was stopped.
This commit is contained in:
+1
-1
@@ -209,6 +209,7 @@ static int audio_callback(sts_mixer_sample_t *sample, void *data)
|
||||
struct movie_context *movie_load(const char *filename)
|
||||
{
|
||||
struct movie_context *mc = xcalloc(1, sizeof(struct movie_context));
|
||||
mc->voice = -1;
|
||||
char *path = gamedir_path(filename);
|
||||
int ret;
|
||||
if ((ret = avformat_open_input(&mc->format_ctx, path, NULL, NULL)) != 0) {
|
||||
@@ -257,7 +258,6 @@ struct movie_context *movie_load(const char *filename)
|
||||
|
||||
mc->format_mutex = SDL_CreateMutex();
|
||||
mc->timer_mutex = SDL_CreateMutex();
|
||||
mc->voice = -1;
|
||||
mc->volume = 100;
|
||||
|
||||
preload_packets(mc);
|
||||
|
||||
+1
-1
@@ -111,6 +111,7 @@ static void update_texture(GLuint unit, GLuint texture, plm_plane_t *plane)
|
||||
struct movie_context *movie_load(const char *filename)
|
||||
{
|
||||
struct movie_context *mc = xcalloc(1, sizeof(struct movie_context));
|
||||
mc->voice = -1;
|
||||
char *path = gamedir_path(filename);
|
||||
FILE *fp = file_open_utf8(path, "rb");
|
||||
if (!fp) {
|
||||
@@ -142,7 +143,6 @@ struct movie_context *movie_load(const char *filename)
|
||||
|
||||
mc->decoder_mutex = SDL_CreateMutex();
|
||||
mc->timer_mutex = SDL_CreateMutex();
|
||||
mc->voice = -1;
|
||||
mc->volume = 100;
|
||||
return mc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user