[vlc-devel] [Patches] Dash: mostly cosmetics

Tobias Güntner fatbull at web.de
Fri Nov 25 19:03:22 CET 2011


Am 25.11.2011 16:30, schrieb Hugo Beauzée-Luyssen:
> I'll let you decide about "Removing EOFException"

Even if you keep the EOFException, it might be a good idea to get rid of 
all exception specifications. If something unexpected is 
thrown/propagated, std::unexpected() will be called, which will 
terminate the program by default. For example, getNextChunk() is 
declared as throw(EOFException), but the std::vector<ISegment*> in there 
could throw std::bad_alloc. Of course you have to actually catch those 
exceptions somewhere. ;)

> +    if ( this->mpdManager == NULL || this->currentPeriod == NULL )
> +        return NULL;

IMHO you should check this in the constructor and throw 
std::invalid_argument instead.

> +    delete this->adaptationLogic;
> +    delete this->mpdManager;

This calls for some kind of auto_ptr. ;) The copy constructor and 
operator= of DASHManager should be disabled as well (i.e., make them 
private).

Regards,
Tobias




More information about the vlc-devel mailing list