gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-commit] gnash ChangeLog backend/sound_handler.h backend...


From: strk
Subject: Re: [Gnash-commit] gnash ChangeLog backend/sound_handler.h backend...
Date: Fri, 27 Jul 2007 17:16:13 +0200

On Fri, Jul 27, 2007 at 03:09:42PM +0000, Tomas Groth wrote:

> +unsigned int GST_sound_handler::get_duration(int sound_handle)
> +{
> +     mutex::scoped_lock lock(_mutex);
> +
> +     // Check if the sound exists.
> +     if (sound_handle < 0 || (unsigned int) sound_handle >= 
> m_sound_data.size())
> +     {
> +             // Invalid handle.
> +             return 0;
> +     }
> +
> +     sound_data* sounddata = m_sound_data[sound_handle];

Could we substitute the above block with a getSoundData(int sound_handle) ?
The getSoundData function would return NULL if the handle is invalid, and we'd 
have
a single implementation rather then duplicated ones (see duplication in 
get_position,
and in both SDL and GST versions).

--strk;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]