[vlc-devel] commit: Look for "Title" entry in title 0, instead of always using entry 3 (Laurent Aimar )
git version control
git at videolan.org
Sat Aug 2 17:37:33 CEST 2008
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sat Aug 2 17:38:50 2008 +0200| [be95e90b85bf0b70c2b87222852d1f0c36b3b0f8] | committer: Laurent Aimar
Look for "Title" entry in title 0, instead of always using entry 3
for going to the DVD menu.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=be95e90b85bf0b70c2b87222852d1f0c36b3b0f8
---
modules/gui/qt4/input_manager.cpp | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index defd89d..955c863 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -414,9 +414,22 @@ void InputManager::sectionMenu()
{
if( hasInput() )
{
- // FIXME we should not assume that but probably find the entry named "Root" in "title 0"
- vlc_value_t val; val.i_int = 2;
- var_Set( p_input, "title 0", val );
+ vlc_value_t val, text;
+ vlc_value_t root;
+
+ if( var_Change( p_input, "title 0", VLC_VAR_GETLIST, &val, &text ) < 0 )
+ return;
+
+ /* XXX is it "Root" or "Title" we want here ?" (set 0 by default) */
+ root.i_int = 0;
+ for( int i = 0; i < val.p_list->i_count; i++ )
+ {
+ if( !strcmp( text.p_list->p_values[i].psz_string, "Title" ) )
+ root.i_int = i;
+ }
+ var_Change( p_input, "title 0", VLC_VAR_FREELIST, &val, &text );
+
+ var_Set( p_input, "title 0", root );
}
}
More information about the vlc-devel
mailing list