Skip to content
  • Filip Roséen's avatar
    mkv: Added reconstruct function to EbmlParser · 6487b499
    Filip Roséen authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
    
    
    The two overloads of EbmlParser::reconstruct has been added due to the
    fact that there are _a lot_ of places in the code following the below:
    
        delete ep;
        ep = new EbmlParser (a, b, c, b);
    
    The above will, unless the compiler feels cocky and optimizes it to what
    is included in this patch. First free the memory used, and then allocate
    new memory for a new EbmlParser.
    
    Instead of doing what is effectively a reallocation, this patch
    introduces EbmlParser::reconstruct which will reconstruct the object
    in-place (without actually having to reallocate the underlying storage).
    
    Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
    6487b499