Commit f1457ea3 authored by Denis Charmet's avatar Denis Charmet

Fix MKV multiple edition handling

This use the default edition and properly signals the core that the title has changed
Fix  #10542
parent 2f3c89c9
...@@ -370,8 +370,9 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) ...@@ -370,8 +370,9 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
p_sys->p_current_segment->p_current_chapter = p_sys->p_current_segment->editions[p_sys->p_current_segment->i_current_edition]->getChapterbyTimecode(0); p_sys->p_current_segment->p_current_chapter = p_sys->p_current_segment->editions[p_sys->p_current_segment->i_current_edition]->getChapterbyTimecode(0);
Seek( p_demux, (int64_t)p_sys->titles[i_idx]->seekpoint[0]->i_time_offset, -1, NULL); Seek( p_demux, (int64_t)p_sys->titles[i_idx]->seekpoint[0]->i_time_offset, -1, NULL);
p_demux->info.i_update |= INPUT_UPDATE_SEEKPOINT; p_demux->info.i_update |= INPUT_UPDATE_SEEKPOINT|INPUT_UPDATE_TITLE;
p_demux->info.i_seekpoint = 0; p_demux->info.i_seekpoint = 0;
p_demux->info.i_title = i_idx;
p_sys->f_duration = (float) p_sys->titles[i_idx]->i_length / 1000.f; p_sys->f_duration = (float) p_sys->titles[i_idx]->i_length / 1000.f;
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
...@@ -267,6 +267,8 @@ virtual_segment_c::virtual_segment_c( std::vector<matroska_segment_c*> * p_opene ...@@ -267,6 +267,8 @@ virtual_segment_c::virtual_segment_c( std::vector<matroska_segment_c*> * p_opene
i_sys_title = 0; i_sys_title = 0;
p_current_chapter = NULL; p_current_chapter = NULL;
i_current_edition = p_segment->i_default_edition;
for( i = 0; i < p_segment->stored_editions.size(); i++ ) for( i = 0; i < p_segment->stored_editions.size(); i++ )
{ {
/* Create a virtual edition from opened */ /* Create a virtual edition from opened */
...@@ -276,9 +278,16 @@ virtual_segment_c::virtual_segment_c( std::vector<matroska_segment_c*> * p_opene ...@@ -276,9 +278,16 @@ virtual_segment_c::virtual_segment_c( std::vector<matroska_segment_c*> * p_opene
* on an other segment which couldn't be found... ignore it */ * on an other segment which couldn't be found... ignore it */
if(p_vedition->b_ordered && p_vedition->i_duration == 0) if(p_vedition->b_ordered && p_vedition->i_duration == 0)
{ {
msg_Warn( &p_segment->sys.demuxer, msg_Warn( &p_segment->sys.demuxer,
"Edition %s (%zu) links to other segments not found and is empty... ignoring it", "Edition %s (%zu) links to other segments not found and is empty... ignoring it",
p_vedition->GetMainName().c_str(), i ); p_vedition->GetMainName().c_str(), i );
if(i_current_edition == i)
{
msg_Warn( &p_segment->sys.demuxer,
"Empty edition was the default... defaulting to 0");
i_current_edition = 0;
}
delete p_vedition; delete p_vedition;
} }
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment