Hi Stefan et al,

I think there's a bug in AmAudioFrontlist::get().

If the playlist is empty and there no back audio object, the function
returns <size> without copying any data.  But, when AmPlaylist is
empty, it will fill the return buffer with zeroes.  I think that
AmAudioFrontlist::get() should defer to AmPlaylist when there is no
back audio, to do the zero fill.

Here how I would change the code:

int AmAudioFrontlist::put(unsigned int user_ts, unsigned char* buffer,
unsigned int size) {
  // stay consistent with Playlist - if empty return size
  int res = size;
  ba_mut.lock();

  if (isEmpty() && back_audio) {
    res = back_audio->put(user_ts, buffer, size);
  // defer to AmPlaylist if not empty or no back_audio
  } else {
    res = AmPlaylist::put(user_ts, buffer, size);
  }            

  ba_mut.unlock();
  return res;         
}


-- 
Mark Sidell
Partner
Forte, Inc.
919-942-7068
fax 919-969-2844
www.forteinc.com
_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems

Reply via email to