r33091 - trunk/gui/mplayer/gtk/gtk_menu.c
Author: ib Date: Mon Mar 21 13:46:03 2011 New Revision: 33091 Log: Correct VCD's titles menu. Limit menu entries to number of titles available on the VCD. Modified: trunk/gui/mplayer/gtk/gtk_menu.c Modified: trunk/gui/mplayer/gtk/gtk_menu.c ============================================================================== --- trunk/gui/mplayer/gtk/gtk_menu.c Mon Mar 21 13:44:17 2011 (r33090) +++ trunk/gui/mplayer/gtk/gtk_menu.c Mon Mar 21 13:46:03 2011 (r33091) @@ -456,11 +456,11 @@ GtkWidget * create_PopUpMenu( void ) if ( guiIntfStruct.VCDTracks ) { char tmp[32]; int i; - for ( i=0;i < guiIntfStruct.VCDTracks;i++ ) + for ( i=1;i < guiIntfStruct.VCDTracks;i++ ) { - snprintf( tmp,32,MSGTR_MENU_Title,i+1 ); - //AddMenuItem( VCDTitleMenu,tmp,( (i+1) << 16 ) + evSetVCDTrack ); - AddMenuItem(window1, (const char*)empty_xpm, VCDTitleMenu,tmp,( (i+1) << 16 ) + evSetVCDTrack ); + snprintf( tmp,32,MSGTR_MENU_Title,i ); + //AddMenuItem( VCDTitleMenu,tmp,( i << 16 ) + evSetVCDTrack ); + AddMenuItem(window1, (const char*)empty_xpm, VCDTitleMenu,tmp,( i << 16 ) + evSetVCDTrack ); } } else
On Mon, Mar 21, 2011 at 01:46:03PM +0100, ib wrote:
Author: ib Date: Mon Mar 21 13:46:03 2011 New Revision: 33091
Log: Correct VCD's titles menu.
Limit menu entries to number of titles available on the VCD.
Modified: trunk/gui/mplayer/gtk/gtk_menu.c
Modified: trunk/gui/mplayer/gtk/gtk_menu.c ============================================================================== --- trunk/gui/mplayer/gtk/gtk_menu.c Mon Mar 21 13:44:17 2011 (r33090) +++ trunk/gui/mplayer/gtk/gtk_menu.c Mon Mar 21 13:46:03 2011 (r33091) @@ -456,11 +456,11 @@ GtkWidget * create_PopUpMenu( void ) if ( guiIntfStruct.VCDTracks ) { char tmp[32]; int i; - for ( i=0;i < guiIntfStruct.VCDTracks;i++ ) + for ( i=1;i < guiIntfStruct.VCDTracks;i++ )
That seems wrong. If there are e.g. two tracks you'll add only one menu entry now?
Reimar Döffinger wrote on Mon, 21 Mar 2011 18:39:37 +0100:
- for ( i=0;i < guiIntfStruct.VCDTracks;i++ ) + for ( i=1;i < guiIntfStruct.VCDTracks;i++ )
That seems wrong. If there are e.g. two tracks you'll add only one menu entry now?
The first track of a normal VCD contains a file system, thus the data tracks start with the 2nd one. STREAM_CTRL_GET_NUM_CHAPTERS returns the number of data tracks plus the file system track and thus is (and was) by 1 too large. I've extensively tested VCD functions. Until now, a non-existing last track could be selected in a variety of ways, which is corrected now. According to the VCD documentation special VCDs without a file system track are said to exist. With these, there would be no menu entry (which shouldn't be a big problem), but on the other hand I'm quite sure that lots of the other, existing VCD code will somehow or other fail on them, too. I couldn't create such a VCD, but if anyone knows where I can get an image or how to create it, I'd like to check such a VCD and fix arising bugs. Ingo
participants (3)
-
ib -
Ingo Brückl -
Reimar Döffinger