From 9e2040e1b79d8ea75fd3a2926ff77c701621b47d Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Wed, 1 May 2013 18:27:20 +0200 Subject: [PATCH 1/5] set video initialization value in CSongMenuFramework.cs to -1. otherwise it will try to unload the wrong stream on start up. --- VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs b/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs index 8ff84dc1..b3f6fa87 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs @@ -237,6 +237,7 @@ namespace VocaluxeLib.Menu.SongMenu protected CSongMenuFramework(int partyModeID) { _PartyModeID = partyModeID; + _Video = -1; _Theme = new SThemeSongMenu { SongMenuTileBoard = From 7845c74e131c37e48ab020936a22b5727d54a180 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Wed, 1 May 2013 18:32:18 +0200 Subject: [PATCH 2/5] do not load background music video if it isn't needed --- Vocaluxe/Base/CBackgroundMusic.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vocaluxe/Base/CBackgroundMusic.cs b/Vocaluxe/Base/CBackgroundMusic.cs index 0aa110b2..97c06f86 100644 --- a/Vocaluxe/Base/CBackgroundMusic.cs +++ b/Vocaluxe/Base/CBackgroundMusic.cs @@ -136,7 +136,7 @@ namespace Vocaluxe.Base if (CConfig.BackgroundMusicSource != EBackgroundMusicSource.TR_CONFIG_ONLY_OWN_MUSIC) AddBackgroundMusic(); - if (CConfig.VideoBackgrounds == EOffOn.TR_CONFIG_ON) + if (CConfig.VideoBackgrounds == EOffOn.TR_CONFIG_ON && CConfig.VideoBackgrounds == EOffOn.TR_CONFIG_ON) _VideoEnabled = true; IsPlaying = false; From 7b91dd1748f89990de3a3e53e21ab9145ef35732 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Wed, 1 May 2013 19:01:37 +0200 Subject: [PATCH 3/5] restore ids when closing audio streams --- GstreamerHelper/GstreamerAudio.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GstreamerHelper/GstreamerAudio.cpp b/GstreamerHelper/GstreamerAudio.cpp index 365dc3f4..1e5f6baf 100644 --- a/GstreamerHelper/GstreamerAudio.cpp +++ b/GstreamerHelper/GstreamerAudio.cpp @@ -83,6 +83,7 @@ DllExport void Close(int Stream) if(it != Streams.end()) { delete it->second; + IDs.push(it->first); Streams.erase(it); } } @@ -236,6 +237,7 @@ DllExport void Update(void) if(p->second->Closed) { delete p->second; + IDs.push(p->first); Streams.erase(p++); } else { From 8fd0527be1bf8d0517da0bd5d5900ce5e820a9d5 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Wed, 1 May 2013 21:20:23 +0200 Subject: [PATCH 4/5] fixed typo --- Vocaluxe/Base/CBackgroundMusic.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vocaluxe/Base/CBackgroundMusic.cs b/Vocaluxe/Base/CBackgroundMusic.cs index 97c06f86..bcf1f712 100644 --- a/Vocaluxe/Base/CBackgroundMusic.cs +++ b/Vocaluxe/Base/CBackgroundMusic.cs @@ -136,7 +136,7 @@ namespace Vocaluxe.Base if (CConfig.BackgroundMusicSource != EBackgroundMusicSource.TR_CONFIG_ONLY_OWN_MUSIC) AddBackgroundMusic(); - if (CConfig.VideoBackgrounds == EOffOn.TR_CONFIG_ON && CConfig.VideoBackgrounds == EOffOn.TR_CONFIG_ON) + if (CConfig.VideoBackgrounds == EOffOn.TR_CONFIG_ON && CConfig.VideosToBackground == EOffOn.TR_CONFIG_ON) _VideoEnabled = true; IsPlaying = false; From 036cc3b4bd3221f6bcaad166b1ee3fea94df7788 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Thu, 2 May 2013 09:25:11 +0200 Subject: [PATCH 5/5] fixed crash (if you click very fast on next song). please check if there are any memory leaks now. --- GstreamerHelper/GstreamerAudioStream.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/GstreamerHelper/GstreamerAudioStream.cpp b/GstreamerHelper/GstreamerAudioStream.cpp index 212b9eaa..7fbf632a 100644 --- a/GstreamerHelper/GstreamerAudioStream.cpp +++ b/GstreamerHelper/GstreamerAudioStream.cpp @@ -92,11 +92,14 @@ int GstreamerAudioStream::Load(const wchar_t* Media, bool Prescan) void GstreamerAudioStream::Close(void) { if(Element) + { gst_element_set_state(Element, GST_STATE_NULL); + gst_object_unref(GST_OBJECT (Element)); + } + + /* without that there are no crashes any more. but i don't know if there is a memory leak if we do that. if(Bus) gst_object_unref(Bus); - if(Element) - gst_object_unref(Element); if(Message) gst_message_unref(Message); if(Convert) @@ -109,6 +112,8 @@ void GstreamerAudioStream::Close(void) gst_object_unref(GhostPad); if(SinkBin) gst_object_unref(SinkBin); + */ + if(FadeTimer) g_timer_destroy (FadeTimer);