[vlc-devel] [PATCH 5/8] mkv: a subchapter with no end timestamp cannot match the chapter looked for

Steve Lhomme robux4 at gmail.com
Thu Mar 17 17:40:39 CET 2016


On Wed, Mar 16, 2016 at 2:46 PM, Denis Charmet <typx at dinauz.org> wrote:
> On 2016-03-16 13:43, Steve Lhomme wrote:
>>
>> ---
>>  modules/demux/mkv/virtual_segment.cpp | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/modules/demux/mkv/virtual_segment.cpp
>> b/modules/demux/mkv/virtual_segment.cpp
>> index bda0883..5b6193d 100644
>> --- a/modules/demux/mkv/virtual_segment.cpp
>> +++ b/modules/demux/mkv/virtual_segment.cpp
>> @@ -377,7 +377,8 @@ virtual_chapter_c*
>> virtual_chapter_c::getSubChapterbyTimecode( int64_t time )
>>  {
>>      for( size_t i = 0; i < sub_vchapters.size(); i++ )
>>      {
>> -        if( time >= sub_vchapters[i]->i_mk_virtual_start_time &&
>> time < sub_vchapters[i]->i_mk_virtual_stop_time )
>> +        if( time >= sub_vchapters[i]->i_mk_virtual_start_time &&
>> +            ( sub_vchapters[i]->i_mk_virtual_stop_time < 0 || time <
>> sub_vchapters[i]->i_mk_virtual_stop_time ) )
>
>
> With this you will most likely always return the first chapter if there are
> no stop time.

The first subchapters that starts before the requested timestamp. Also
after the work I did on ordered chapters timestamps, this is only
happening for non-ordered chapters (or if no end is set on the last
chapter).

Technically speaking the method is (now) called ContainsTimestamp() so
this result is still correct. But since we look for the most accurate
and refined chapter containing that timestamp it's probably better to
revert this.

I'll submit a fix.

>>              return sub_vchapters[i]->getSubChapterbyTimecode( time );
>>      }
>
>
> Regards,
> --
> Denis Charmet - TypX
> Le mauvais esprit est un art de vivre
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list