changeset 33902:dd0e5dc6ebbf

Add guiDVDStruct members to guiInfo. Additionally, rename nr_of_audio_channels AudioStreams, audio_streams[] AudioStream[], nr_of_subtitles Subtitles and subtitles[] Subtitle[].
author ib
date Mon, 15 Aug 2011 18:37:10 +0000
parents d4f80f889106
children 95f5f330a4ff
files gui/interface.c gui/interface.h gui/ui/gtk/menu.c gui/ui/main.c gui/win32/interface.c
diffstat 5 files changed, 31 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/gui/interface.c	Mon Aug 15 13:27:58 2011 +0000
+++ b/gui/interface.c	Mon Aug 15 18:37:10 2011 +0000
@@ -657,10 +657,10 @@
             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;
--- a/gui/interface.h	Mon Aug 15 13:27:58 2011 +0000
+++ b/gui/interface.h	Mon Aug 15 18:37:10 2011 +0000
@@ -87,13 +87,6 @@
 };
 
 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 @@
     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 @@
     int Track;                // public, read access by MPlayer
 
 #ifdef CONFIG_DVDREAD
-    guiDVDStruct DVD;
     int Chapters;
     int Chapter;              // public, write access by MPlayer
     int Angles;
--- a/gui/ui/gtk/menu.c	Mon Aug 15 13:27:58 2011 +0000
+++ b/gui/ui/gtk/menu.c	Mon Aug 15 18:37:10 2011 +0000
@@ -510,18 +510,18 @@
         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 @@
         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
--- a/gui/ui/main.c	Mon Aug 15 13:27:58 2011 +0000
+++ b/gui/ui/main.c	Mon Aug 15 18:37:10 2011 +0000
@@ -116,7 +116,8 @@
 #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;
--- a/gui/win32/interface.c	Mon Aug 15 13:27:58 2011 +0000
+++ b/gui/win32/interface.c	Mon Aug 15 18:37:10 2011 +0000
@@ -522,10 +522,10 @@
                     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;