[MPlayer-cvslog] r36554 - in trunk: access_mpcontext.h gui/dialog/menu.c mplayer.c
ib
subversion at mplayerhq.hu
Tue Dec 17 23:31:30 CET 2013
Author: ib
Date: Tue Dec 17 23:31:30 2013
New Revision: 36554
Log:
Add mpctx_get_global_sub_pos().
This avoids direct context access.
Modified:
trunk/access_mpcontext.h
trunk/gui/dialog/menu.c
trunk/mplayer.c
Modified: trunk/access_mpcontext.h
==============================================================================
--- trunk/access_mpcontext.h Tue Dec 17 23:30:06 2013 (r36553)
+++ trunk/access_mpcontext.h Tue Dec 17 23:31:30 2013 (r36554)
@@ -26,6 +26,7 @@ void *mpctx_get_demuxer(struct MPContext
void *mpctx_get_playtree_iter(struct MPContext *mpctx);
void *mpctx_get_mixer(struct MPContext *mpctx);
int mpctx_get_global_sub_size(struct MPContext *mpctx);
+int mpctx_get_global_sub_pos(struct MPContext *mpctx);
int mpctx_get_osd_function(struct MPContext *mpctx);
#endif /* MPLAYER_ACCESS_MPCONTEXT_H */
Modified: trunk/gui/dialog/menu.c
==============================================================================
--- trunk/gui/dialog/menu.c Tue Dec 17 23:30:06 2013 (r36553)
+++ trunk/gui/dialog/menu.c Tue Dec 17 23:31:30 2013 (r36554)
@@ -654,14 +654,15 @@ GtkWidget * CreatePopUpMenu( void )
/* cheap subtitle switching for non-DVD streams */
if ( global_sub_size && guiInfo.StreamType != STREAMTYPE_DVD )
{
- int i;
+ int pos, i;
+ pos = mpctx_get_global_sub_pos(guiInfo.mpcontext);
SubMenu=AddSubMenu( window1, (const char*)subtitle_xpm, Menu, MSGTR_MENU_Subtitles );
- AddMenuCheckItem( window1, (const char*)empty1px_xpm, SubMenu, MSGTR_MENU_None, guiInfo.mpcontext->global_sub_pos == -1, (-1 << 16) + ivSetSubtitle );
+ AddMenuCheckItem( window1, (const char*)empty1px_xpm, SubMenu, MSGTR_MENU_None, pos == -1, (-1 << 16) + ivSetSubtitle );
for ( i=0;i < global_sub_size;i++ )
{
char tmp[32];
snprintf( tmp, 32, MSGTR_MENU_Track, i );
- AddMenuCheckItem( window1,(const char*)empty1px_xpm,SubMenu,tmp,guiInfo.mpcontext->global_sub_pos == i,( i << 16 ) + ivSetSubtitle );
+ AddMenuCheckItem( window1,(const char*)empty1px_xpm,SubMenu,tmp,pos == i,( i << 16 ) + ivSetSubtitle );
}
}
Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c Tue Dec 17 23:30:06 2013 (r36553)
+++ trunk/mplayer.c Tue Dec 17 23:31:30 2013 (r36554)
@@ -365,6 +365,11 @@ int mpctx_get_global_sub_size(MPContext
return mpctx->global_sub_size;
}
+int mpctx_get_global_sub_pos(MPContext *mpctx)
+{
+ return mpctx->global_sub_pos;
+}
+
int mpctx_get_osd_function(MPContext *mpctx)
{
return mpctx->osd_function;
More information about the MPlayer-cvslog
mailing list