Previous 15994 Revisions Next

r12552 Wednesday 10th August, 2011 at 07:52:20 UTC by Firewave
fixed memory leak in device_sound_interface::static_add_route() (no whatsnew)
[src/emu]disound.c disound.h

src/emu/disound.c
r12551r12552
8181   // append a new route to the list
8282   astring devtag;
8383   device.siblingtag(devtag, target);
84   sound->m_route_list.append(*global_alloc(sound_route(output, input, gain, core_strdup(devtag.cstr()))));
84   sound->m_route_list.append(*global_alloc(sound_route(output, input, gain, devtag.cstr())));
8585}
8686
8787
r12551r12552
232232      const device_t *target = device().mconfig().devicelist().find(route->m_target);
233233      if (target == NULL)
234234      {
235         mame_printf_error("%s: %s attempting to route sound to non-existant device '%s'\n", driver.source_file, driver.name, route->m_target);
235         mame_printf_error("%s: %s attempting to route sound to non-existant device '%s'\n", driver.source_file, driver.name, route->m_target.cstr());
236236         error = true;
237237      }
238238
r12551r12552
240240      const device_sound_interface *sound;
241241      if (target != NULL && target->type() != SPEAKER && !target->interface(sound))
242242      {
243         mame_printf_error("%s: %s attempting to route sound to a non-sound device '%s' (%s)\n", driver.source_file, driver.name, route->m_target, target->name());
243         mame_printf_error("%s: %s attempting to route sound to a non-sound device '%s' (%s)\n", driver.source_file, driver.name, route->m_target.cstr(), target->name());
244244         error = true;
245245      }
246246   }
r12551r12552
316316                  int streamoutputnum;
317317                  sound_stream *outputstream = sound->output_to_stream_output(outputnum, streamoutputnum);
318318                  if (outputstream == NULL)
319                     fatalerror("Sound device '%s' specifies route for non-existant output #%d", route->m_target, outputnum);
319                     fatalerror("Sound device '%s' specifies route for non-existant output #%d", route->m_target.cstr(), outputnum);
320320
321321                  // find the input stream to connect to
322322                  int streaminputnum;
323323                  sound_stream *inputstream = input_to_stream_input(inputnum++, streaminputnum);
324324                  if (inputstream == NULL)
325                     fatalerror("Sound device '%s' targeted output #%d to non-existant device '%s' input %d", route->m_target, outputnum, m_device.tag(), inputnum - 1);
325                     fatalerror("Sound device '%s' targeted output #%d to non-existant device '%s' input %d", route->m_target.cstr(), outputnum, m_device.tag(), inputnum - 1);
326326
327327                  // set the input
328328                  inputstream->set_input(streaminputnum, outputstream, streamoutputnum, route->m_gain);
src/emu/disound.h
r12551r12552
109109      UINT32            m_output;         // output index, or ALL_OUTPUTS
110110      UINT32            m_input;         // target input index
111111      float            m_gain;            // gain
112      const char *      m_target;         // target tag
112      astring            m_target;         // target tag
113113   };
114114
115115   // construction/destruction

Previous 15994 Revisions Next


© 1998-2018 The MESS Team