< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index  

Re: [reSIProcate] Inconsistent return values of findFirstMatchingCodecs() ?


...

On Fri, Dec 12, 2008 at 4:10 PM, Gabriel Hege
<gabriel-mailinglists@xxxxxx> wrote:
> Hi,
>
> I have got a question about the function findFirstMatchingCodecs() in
> SdpContents::Session::Medium.
>
> As I understand it this function has two ways of returning the matching
> codec: either as the return value or in the pointer pMatchingCodec. The
> problem is, that these two return two different values. The former returns a
> codec from the internalCodecList where the latter contains a codec from the
> the other codecList (sIter vs. eIter).
> This would not be a problem if these two were really identical, but since
> the operator==(const Codec&, const Codec&) does not compare the value of the
> fmtp-String stored in Codec::mParameters.
>
> Was this intentional? (-> the 's' at the end of the function name?) Then it
> should somehow be made clear which is which. And also to which list the
> "first" in the name applies.

I will add the following comments to the header file to make things clear.

// Search through this mediums codecs to find and return the first
match from the passed in list
// Note:  The codecList item that matched the codec from the medium is
passed back via pMatchingCodec
//        if a non-NULL pointer is passed in.  The codec returned if
from this medium.
const Codec& findFirstMatchingCodecs(const std::list<Codec>&
codecList, Codec* pMatchingCodec = 0) const;
// Search through this mediums codecs to find and return the first
match from the passed in medium
// Note:  The passed in medium's codec that matched the codec from
this medium is passed back
//        via pMatchingCodec if a non-NULL pointer is passed in.  The
codec returned if from this medium.
const Codec& findFirstMatchingCodecs(const Medium& medium, Codec*
pMatchingCodec = 0) const;

>
> Side note:
> A variable "bool found" is defined and set in In findFirstMatchingCodecs but
> is never being evaluated.

Thanks - I'll remove it.

> greetings,
>  gabriel
>
> _______________________________________________
> resiprocate-devel mailing list
> resiprocate-devel@xxxxxxxxxxxxxxx
> https://list.resiprocate.org/mailman/listinfo/resiprocate-devel
>