Module: sems Branch: master Commit: c54c98a2757068834ba73559bf03fad91dff0c73 URL: https://github.com/sems-server/sems/commit/c54c98a2757068834ba73559bf03fad91dff0c73
Author: Stefan Sayer <[email protected]> Committer: Stefan Sayer <[email protected]> Date: 2015-03-30T13:23:11+02:00 b/f:conf mixer: fix memory use in conferences without speaker reported by Joe Stusick --- Modified: core/AmMultiPartyMixer.cpp --- Diff: https://github.com/sems-server/sems/commit/c54c98a2757068834ba73559bf03fad91dff0c73.diff Patch: https://github.com/sems-server/sems/commit/c54c98a2757068834ba73559bf03fad91dff0c73.patch --- diff --git a/core/AmMultiPartyMixer.cpp b/core/AmMultiPartyMixer.cpp index b94a5db..94754ef 100644 --- a/core/AmMultiPartyMixer.cpp +++ b/core/AmMultiPartyMixer.cpp @@ -36,6 +36,7 @@ // the internal delay of the mixer (between put and get) #define MIXER_DELAY_MS 20 +#define MAX_BUFFER_STATES 50 // 1 sec max @ 20ms void DEBUG_MIXER_BUFFER_STATE(const MixerBufferState& mbs, const string& context) { @@ -274,8 +275,10 @@ AmMultiPartyMixer::findBufferStateForReading(unsigned int sample_rate, } } - //DBG("XXDebugMixerXX: Creating buffer state (from GetChannelPacket)"); - buffer_state.push_back(MixerBufferState(sample_rate, channelids)); + if (buffer_state.size() < MAX_BUFFER_STATES) { + // DBG("XXDebugMixerXX: Creating buffer state (from GetChannelPacket)\n"); + buffer_state.push_back(MixerBufferState(sample_rate, channelids)); + } // else just reuse the last buffer - conference without a speaker std::deque<MixerBufferState>::reverse_iterator rit = buffer_state.rbegin(); //DEBUG_MIXER_BUFFER_STATE(*((rit + 1).base()), "returned to PutChannelPacket"); return (rit + 1).base(); _______________________________________________ Semsdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/semsdev
