[vlc-devel] [PATCH 2/2] demux:mkv: keep reading data in the parent even if current element has no size

Steve Lhomme robux4 at gmail.com
Mon Nov 27 17:40:39 CET 2017


Fixes #19097 with the 2 previous patches.

On Mon, Nov 27, 2017 at 5:31 PM, Steve Lhomme <robux4 at videolabs.io> wrote:
> ---
>  modules/demux/mkv/Ebml_parser.cpp | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/modules/demux/mkv/Ebml_parser.cpp b/modules/demux/mkv/Ebml_parser.cpp
> index f503493213..3f9a3ae668 100644
> --- a/modules/demux/mkv/Ebml_parser.cpp
> +++ b/modules/demux/mkv/Ebml_parser.cpp
> @@ -164,7 +164,20 @@ EbmlElement *EbmlParser::Get( int n_call )
>      else if (!m_el[mi_level-1]->IsFiniteSize())
>          i_max_read = UINT64_MAX;
>      else if (!p_prev)
> +    {
>          i_max_read = m_el[mi_level-1]->GetSize();
> +        if (i_max_read == 0)
> +        {
> +            /* check if the parent still has data to read */
> +            if ( mi_level > 1 &&
> +                 m_el[mi_level-1]->GetEndPosition() < m_el[mi_level-2]->GetEndPosition() )
> +            {
> +                uint64 top = m_el[mi_level-2]->GetEndPosition();
> +                uint64 bom = m_el[mi_level-1]->GetEndPosition();
> +                i_max_read = top - bom;
> +            }
> +        }
> +    }
>      else {
>          size_t size_lvl = mi_level;
>          while ( size_lvl && m_el[size_lvl-1]->IsFiniteSize() &&
> --
> 2.14.2
>


More information about the vlc-devel mailing list