[MPlayer-cvslog] r33990 - in trunk/gui: interface.c interface.h ui/gtk/menu.c ui/main.c win32/interface.c

ib subversion at mplayerhq.hu
Mon Aug 15 20:37:10 CEST 2011


Author: ib
Date: Mon Aug 15 20:37:10 2011
New Revision: 33990

Log:
Add guiDVDStruct members to guiInfo.

Additionally, rename nr_of_audio_channels AudioStreams, audio_streams[]
AudioStream[], nr_of_subtitles Subtitles and subtitles[] Subtitle[].

Modified:
   trunk/gui/interface.c
   trunk/gui/interface.h
   trunk/gui/ui/gtk/menu.c
   trunk/gui/ui/main.c
   trunk/gui/win32/interface.c

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Mon Aug 15 15:27:58 2011	(r33989)
+++ trunk/gui/interface.c	Mon Aug 15 20:37:10 2011	(r33990)
@@ -657,10 +657,10 @@ int gui(int what, void *data)
             guiInfo.Tracks   = dvd->vmg_file->tt_srpt->nr_of_srpts;
             guiInfo.Chapters = dvd->vmg_file->tt_srpt->title[dvd_title].nr_of_ptts;
             guiInfo.Angles   = dvd->vmg_file->tt_srpt->title[dvd_title].nr_of_angles;
-            guiInfo.DVD.nr_of_audio_channels = dvd->nr_of_channels;
-            memcpy(guiInfo.DVD.audio_streams, dvd->audio_streams, sizeof(dvd->audio_streams));
-            guiInfo.DVD.nr_of_subtitles = dvd->nr_of_subtitles;
-            memcpy(guiInfo.DVD.subtitles, dvd->subtitles, sizeof(dvd->subtitles));
+            guiInfo.AudioStreams = dvd->nr_of_channels;
+            memcpy(guiInfo.AudioStream, dvd->audio_streams, sizeof(dvd->audio_streams));
+            guiInfo.Subtitles = dvd->nr_of_subtitles;
+            memcpy(guiInfo.Subtitle, dvd->subtitles, sizeof(dvd->subtitles));
             guiInfo.Track   = dvd_title + 1;
             guiInfo.Chapter = dvd_chapter + 1;
             guiInfo.Angle   = dvd_angle + 1;

Modified: trunk/gui/interface.h
==============================================================================
--- trunk/gui/interface.h	Mon Aug 15 15:27:58 2011	(r33989)
+++ trunk/gui/interface.h	Mon Aug 15 20:37:10 2011	(r33990)
@@ -87,13 +87,6 @@ enum {
 };
 
 typedef struct {
-    int nr_of_audio_channels;
-    stream_language_t audio_streams[32];
-    int nr_of_subtitles;
-    stream_language_t subtitles[32];
-} guiDVDStruct;
-
-typedef struct {
     MPContext *mpcontext;
     sh_video_t *sh_video;
     af_stream_t *afilter;
@@ -105,6 +98,14 @@ typedef struct {
     int StreamType;           // public, read access by MPlayer
     int AudioChannels;
 
+#ifdef CONFIG_DVDREAD
+    int AudioStreams;
+    stream_language_t AudioStream[32];
+
+    int Subtitles;
+    stream_language_t Subtitle[32];
+#endif
+
     char *Filename;           // public, read access by MPlayer
     char *AudioFilename;
     char *SubtitleFilename;
@@ -116,7 +117,6 @@ typedef struct {
     int Track;                // public, read access by MPlayer
 
 #ifdef CONFIG_DVDREAD
-    guiDVDStruct DVD;
     int Chapters;
     int Chapter;              // public, write access by MPlayer
     int Angles;

Modified: trunk/gui/ui/gtk/menu.c
==============================================================================
--- trunk/gui/ui/gtk/menu.c	Mon Aug 15 15:27:58 2011	(r33989)
+++ trunk/gui/ui/gtk/menu.c	Mon Aug 15 20:37:10 2011	(r33990)
@@ -510,18 +510,18 @@ GtkWidget * create_PopUpMenu( void )
         gtk_widget_set_sensitive( MenuItem,FALSE );
        }
     DVDAudioLanguageMenu=AddSubMenu( window1, (const char*)audiolang_xpm, DVDSubMenu,MSGTR_MENU_AudioLanguages );
-     if ( guiInfo.DVD.nr_of_audio_channels )
+     if ( guiInfo.AudioStreams )
       {
        char tmp[64]; int i, id = demuxer ? demuxer->audio->id : audio_id;
-       for ( i=0;i < guiInfo.DVD.nr_of_audio_channels;i++ )
+       for ( i=0;i < guiInfo.AudioStreams;i++ )
         {
-	 snprintf( tmp,64,"%s - %s %s",GetLanguage( guiInfo.DVD.audio_streams[i].language ),
-	   ChannelTypes[ guiInfo.DVD.audio_streams[i].type ],
-	   ChannelNumbers[ guiInfo.DVD.audio_streams[i].channels ] );
-//	 if ( id == -1 ) id=audio_id; //guiInfo.DVD.audio_streams[i].id;
+	 snprintf( tmp,64,"%s - %s %s",GetLanguage( guiInfo.AudioStream[i].language ),
+	   ChannelTypes[ guiInfo.AudioStream[i].type ],
+	   ChannelNumbers[ guiInfo.AudioStream[i].channels ] );
+//	 if ( id == -1 ) id=audio_id; //guiInfo.AudioStream[i].id;
          AddMenuCheckItem( window1, (const char*)dolby_xpm, DVDAudioLanguageMenu,tmp,
-			   id == guiInfo.DVD.audio_streams[i].id,
-			   ( guiInfo.DVD.audio_streams[i].id << 16 ) + evSetDVDAudio );
+			   id == guiInfo.AudioStream[i].id,
+			   ( guiInfo.AudioStream[i].id << 16 ) + evSetDVDAudio );
         }
       }
       else
@@ -530,16 +530,16 @@ GtkWidget * create_PopUpMenu( void )
         gtk_widget_set_sensitive( MenuItem,FALSE );
        }
     DVDSubtitleLanguageMenu=AddSubMenu( window1, (const char*)sublang_xpm, DVDSubMenu,MSGTR_MENU_SubtitleLanguages );
-     if ( guiInfo.DVD.nr_of_subtitles )
+     if ( guiInfo.Subtitles )
       {
        char tmp[64]; int i;
        AddMenuItem( window1, (const char*)empty1px_xpm, DVDSubtitleLanguageMenu,MSGTR_MENU_None,( (unsigned short)-1 << 16 ) + evSetDVDSubtitle );
-       for ( i=0;i < guiInfo.DVD.nr_of_subtitles;i++ )
+       for ( i=0;i < guiInfo.Subtitles;i++ )
         {
-         av_strlcpy( tmp,GetLanguage( guiInfo.DVD.subtitles[i].language ),sizeof(tmp) );
+         av_strlcpy( tmp,GetLanguage( guiInfo.Subtitle[i].language ),sizeof(tmp) );
          AddMenuCheckItem( window1, (const char*)empty1px_xpm, DVDSubtitleLanguageMenu,tmp,
-			   dvdsub_id == guiInfo.DVD.subtitles[i].id,
-			   ( guiInfo.DVD.subtitles[i].id << 16 ) + evSetDVDSubtitle );
+			   dvdsub_id == guiInfo.Subtitle[i].id,
+			   ( guiInfo.Subtitle[i].id << 16 ) + evSetDVDSubtitle );
         }
       }
       else

Modified: trunk/gui/ui/main.c
==============================================================================
--- trunk/gui/ui/main.c	Mon Aug 15 15:27:58 2011	(r33989)
+++ trunk/gui/ui/main.c	Mon Aug 15 20:37:10 2011	(r33990)
@@ -116,7 +116,8 @@ static void guiInfoMediumClear (int what
 #ifdef CONFIG_DVDREAD
   if (what & CLEAR_DVD)
   {
-    memset(&guiInfo.DVD, 0, sizeof(guiDVDStruct));
+    guiInfo.AudioStreams = 0;
+    guiInfo.Subtitles = 0;
     guiInfo.Tracks = 0;
     guiInfo.Chapters = 0;
     guiInfo.Angles = 0;

Modified: trunk/gui/win32/interface.c
==============================================================================
--- trunk/gui/win32/interface.c	Mon Aug 15 15:27:58 2011	(r33989)
+++ trunk/gui/win32/interface.c	Mon Aug 15 20:37:10 2011	(r33990)
@@ -522,10 +522,10 @@ int gui(int what, void *data)
                     guiInfo.Tracks = dvdp->vmg_file->tt_srpt->nr_of_srpts;
                     guiInfo.Chapters = dvdp->vmg_file->tt_srpt->title[dvd_title].nr_of_ptts;
                     guiInfo.Angles = dvdp->vmg_file->tt_srpt->title[dvd_title].nr_of_angles;
-                    guiInfo.DVD.nr_of_audio_channels = dvdp->nr_of_channels;
-                    memcpy(guiInfo.DVD.audio_streams, dvdp->audio_streams, sizeof(dvdp->audio_streams));
-                    guiInfo.DVD.nr_of_subtitles = dvdp->nr_of_subtitles;
-                    memcpy(guiInfo.DVD.subtitles, dvdp->subtitles, sizeof(dvdp->subtitles));
+                    guiInfo.AudioStreams = dvdp->nr_of_channels;
+                    memcpy(guiInfo.AudioStream, dvdp->audio_streams, sizeof(dvdp->audio_streams));
+                    guiInfo.Subtitles = dvdp->nr_of_subtitles;
+                    memcpy(guiInfo.Subtitle, dvdp->subtitles, sizeof(dvdp->subtitles));
                     guiInfo.Chapter = dvd_chapter + 1;
                     guiInfo.Angle = dvd_angle + 1;
                     guiInfo.Track = dvd_title + 1;


More information about the MPlayer-cvslog mailing list