[libavg-devel] Error in TrackerConfig.cpp

Ulrich von Zadow uzadow at libavg.de
Thu Feb 21 10:26:48 CET 2008


Daniel Beier wrote:
> Hi again,
> 
>> Sounds like a bug, though I can't test it at the moment. Since you
>> already have a fix: Can you send a patch?
> I've just hacked one solution that I can't send as a patch because its  
> very ugly.
> 
> But I have investigated further and located the bug at:
> 
> void TrackerEventSource::endCalibration()
>      {
>          assert(m_pCalibrator);
>          m_TrackerConfig.m_pTrafo = m_pCalibrator->makeTransformer();
>          setConfig();
>          delete m_pCalibrator;
>          m_pCalibrator = 0;
>          m_pOldTransformer = DeDistortPtr();
>      }
> 
> The assignement of a calibration to m_TrackerConfig.m_pTrafo is not  
> enough, since this pointer is only held in TrackerConfig but not used  
> in:
> 
> void TrackerConfig::save(const string& sFilename)
> {
> ...
>      if (m_Doc)
>          xmlSaveFileEnc(m_sFilename.c_str(), m_Doc, "utf-8");
> ...

Right.

> Since I haven't beed involved in libavg development yet, I'm uncertain  
> how to correctly implement a change without "breaking the rules". I'm  
> going to write an update method in TrackerConfig, which sets the  
> contents of m_Doc via calls to TrackerConfig::setParam method for each  
> parameter. This will be called
> in TrackerEventSource::endCalibration().

Sounds good :-).

(Aside: the whole tracker config architecture needs to be revised. 
Member variables are public, data is being held twice and hence tends to 
inconsistency, type checking in the setters is broken. That's definitely 
something that needs to happen before the next release.)

> If this is ok, I'll happily submit the results - if you have another  
> opinion regarding this I'll try to implement this as well.

Yes, a patch would be great.

Cheers,

   Uli

-- 

Ulrich von Zadow | +49-172-7872715
Jabber: cocacoder at jabber.berlin.ccc.de
Skype: uzadow



More information about the libavg-devel mailing list