Commit 47e83d96 authored by Denis Charmet's avatar Denis Charmet Committed by Jean-Baptiste Kempf

MKV: Do not list chapters and titles when there is only one of them

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit 43424ac2)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 81f96b13
...@@ -531,15 +531,13 @@ int virtual_edition_c::PublishChapters( input_title_t & title, int & i_user_chap ...@@ -531,15 +531,13 @@ 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 */ /* 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(); seekpoint_t *sk = vlc_seekpoint_New();
sk->i_time_offset = 0; sk->i_time_offset = 0;
if( p_edition ) sk->psz_name = strdup( p_edition->psz_name.c_str() );
sk->psz_name = strdup( p_edition->psz_name.c_str() );
else
sk->psz_name = strdup( "Dummy edition" );
title.i_seekpoint++; title.i_seekpoint++;
title.seekpoint = (seekpoint_t**)xrealloc( title.seekpoint, title.seekpoint = (seekpoint_t**)xrealloc( title.seekpoint,
...@@ -551,8 +549,9 @@ int virtual_edition_c::PublishChapters( input_title_t & title, int & i_user_chap ...@@ -551,8 +549,9 @@ int virtual_edition_c::PublishChapters( input_title_t & title, int & i_user_chap
i_seekpoint_num = i_user_chapters; i_seekpoint_num = i_user_chapters;
} }
for( size_t i = 0; i < chapters.size(); i++ ) if( chapters.size() > 1 )
chapters[i]->PublishChapters( title, i_user_chapters, i_level ); for( size_t i = 0; i < chapters.size(); i++ )
chapters[i]->PublishChapters( title, i_user_chapters, i_level );
return i_user_chapters; return i_user_chapters;
} }
......
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