[vlc-commits] Fix MKV multiple edition handling
Denis Charmet
git at videolan.org
Sat Mar 22 19:12:56 CET 2014
vlc | branch: master | Denis Charmet <typx at dinauz.org> | Sat Mar 22 19:10:46 2014 +0100| [f1457ea32f4241f85e73ac47b7030702a24abebc] | committer: Denis Charmet
Fix MKV multiple edition handling
This use the default edition and properly signals the core that the title has changed
Fix #10542
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f1457ea32f4241f85e73ac47b7030702a24abebc
---
modules/demux/mkv/mkv.cpp | 3 ++-
modules/demux/mkv/virtual_segment.cpp | 9 +++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index 8dfe5f1..950fdfe 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -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);
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_title = i_idx;
p_sys->f_duration = (float) p_sys->titles[i_idx]->i_length / 1000.f;
return VLC_SUCCESS;
}
diff --git a/modules/demux/mkv/virtual_segment.cpp b/modules/demux/mkv/virtual_segment.cpp
index 75d8035..3b1b68e 100644
--- a/modules/demux/mkv/virtual_segment.cpp
+++ b/modules/demux/mkv/virtual_segment.cpp
@@ -267,6 +267,8 @@ virtual_segment_c::virtual_segment_c( std::vector<matroska_segment_c*> * p_opene
i_sys_title = 0;
p_current_chapter = NULL;
+ i_current_edition = p_segment->i_default_edition;
+
for( i = 0; i < p_segment->stored_editions.size(); i++ )
{
/* Create a virtual edition from opened */
@@ -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 */
if(p_vedition->b_ordered && p_vedition->i_duration == 0)
{
+
msg_Warn( &p_segment->sys.demuxer,
"Edition %s (%zu) links to other segments not found and is empty... ignoring it",
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;
}
else
More information about the vlc-commits
mailing list