[vlc-commits] MKV: Do not list chapters and titles when there is only one of them
Denis Charmet
git at videolan.org
Wed Dec 14 15:32:19 CET 2011
vlc | branch: master | Denis Charmet <typx at dinauz.org> | Wed Dec 14 15:31:27 2011 +0100| [09917bddf7f280eff3d4a7e6133d10e8c2d68000] | committer: Jean-Baptiste Kempf
MKV: Do not list chapters and titles when there is only one of them
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=09917bddf7f280eff3d4a7e6133d10e8c2d68000
---
modules/demux/mkv/virtual_segment.cpp | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/modules/demux/mkv/virtual_segment.cpp b/modules/demux/mkv/virtual_segment.cpp
index 3388f0c..69c1b5e 100644
--- a/modules/demux/mkv/virtual_segment.cpp
+++ b/modules/demux/mkv/virtual_segment.cpp
@@ -531,15 +531,12 @@ int virtual_edition_c::PublishChapters( input_title_t & title, int & i_user_chap
{
/* HACK for now don't expose edition as a seekpoint if its start time is the same than it's first chapter */
- if( chapters.size() > 0 && chapters[0]->i_virtual_start_time )
+ if( chapters.size() > 0 &&
+ chapters[0]->i_virtual_start_time && p_edition )
{
seekpoint_t *sk = vlc_seekpoint_New();
- sk->i_time_offset = 0;
- if( p_edition )
- sk->psz_name = strdup( p_edition->psz_name.c_str() );
- else
- sk->psz_name = strdup( "Dummy edition" );
+ sk->psz_name = strdup( p_edition->psz_name.c_str() );
title.i_seekpoint++;
title.seekpoint = (seekpoint_t**)xrealloc( title.seekpoint,
@@ -551,8 +548,9 @@ int virtual_edition_c::PublishChapters( input_title_t & title, int & i_user_chap
i_seekpoint_num = i_user_chapters;
}
- for( size_t i = 0; i < chapters.size(); i++ )
- chapters[i]->PublishChapters( title, i_user_chapters, i_level );
+ if( chapters.size() > 1 )
+ for( size_t i = 0; i < chapters.size(); i++ )
+ chapters[i]->PublishChapters( title, i_user_chapters, i_level );
return i_user_chapters;
}
More information about the vlc-commits
mailing list