diff options
author | Joerg Mueller <nexyon@gmail.com> | 2009-08-25 19:30:04 +0400 |
---|---|---|
committer | Joerg Mueller <nexyon@gmail.com> | 2009-08-25 19:30:04 +0400 |
commit | 4ba6dbce767c7e3fe4c91aaca79da6f35d5492c9 (patch) | |
tree | 203e3659a9e790f100ca153490abc1d0bd578e3c | |
parent | 3d7215da581b5c1dac6d566aa43ef3cfccd13c92 (diff) |
Replaced G.sce by Main.name in sound.c.
I hoped for it to resolve the bug of loading sounds with relative paths didn't work, but Main.name isn't set before the sounds are loaded, so the bug resists!
Someone who is into file loading should please fix this!
-rw-r--r-- | intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_sound.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/packedFile.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sound.c | 12 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 2 |
5 files changed, 9 insertions, 10 deletions
diff --git a/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp index de0e47300f8..d70a9c25bcb 100644 --- a/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp +++ b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp @@ -334,7 +334,6 @@ void AUD_FFMPEGReader::read(int & length, sample_t* & buffer) // read packages and decode them AVPacket packet; int data_size = 0; - int pkgbuf_size = m_pkgbuf->getSize(); int pkgbuf_pos; int left = length; int sample_size = AUD_SAMPLE_SIZE(m_specs); diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h index 1dd90b4dbda..84ecd79a008 100644 --- a/source/blender/blenkernel/BKE_sound.h +++ b/source/blender/blenkernel/BKE_sound.h @@ -54,7 +54,7 @@ void sound_delete(struct bContext *C, struct bSound* sound); void sound_cache(struct bSound* sound, int ignore); -void sound_load(struct bSound* sound); +void sound_load(struct Main *main, struct bSound* sound); void sound_free(struct bSound* sound); diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index 8c77ed92aa1..3e47c1006e5 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -473,7 +473,7 @@ int unpackSound(ReportList *reports, bSound *sound, int how) freePackedFile(sound->packedfile); sound->packedfile = 0; - sound_load(sound); + sound_load(NULL, sound); ret_value = RET_OK; } diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 74ab41ff577..c6f9db6fda9 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -78,7 +78,7 @@ struct bSound* sound_new_file(struct Main *main, char* filename) int len; strcpy(str, filename); - BLI_convertstringcode(str, G.sce); + BLI_convertstringcode(str, main->name); len = strlen(filename); while(len > 0 && filename[len-1] != '/' && filename[len-1] != '\\') @@ -88,7 +88,7 @@ struct bSound* sound_new_file(struct Main *main, char* filename) strcpy(sound->name, filename); sound->type = SOUND_TYPE_FILE; - sound_load(sound); + sound_load(main, sound); if(!sound->snd_sound) { @@ -114,7 +114,7 @@ struct bSound* sound_new_buffer(struct bContext *C, struct bSound *source) sound->child_sound = source; sound->type = SOUND_TYPE_BUFFER; - sound_load(sound); + sound_load(CTX_data_main(C), sound); if(!sound->snd_sound) { @@ -140,7 +140,7 @@ struct bSound* sound_new_limiter(struct bContext *C, struct bSound *source, floa sound->end = end; sound->type = SOUND_TYPE_LIMITER; - sound_load(sound); + sound_load(CTX_data_main(C), sound); if(!sound->snd_sound) { @@ -172,7 +172,7 @@ void sound_cache(struct bSound* sound, int ignore) sound->cache = AUD_bufferSound(sound->snd_sound); } -void sound_load(struct bSound* sound) +void sound_load(struct Main *main, struct bSound* sound) { if(sound) { @@ -198,7 +198,7 @@ void sound_load(struct bSound* sound) if(sound->id.lib) path = sound->id.lib->filename; else - path = G.sce; + path = main ? main->name : NULL; BLI_convertstringcode(fullpath, path); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 5cc3ff7695a..920e202520e 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5075,7 +5075,7 @@ static void lib_link_sound(FileData *fd, Main *main) sound->ipo= newlibadr_us(fd, sound->id.lib, sound->ipo); // XXX depreceated - old animation system sound->stream = 0; - sound_load(sound); + sound_load(main, sound); } sound= sound->id.next; } |