[MPlayer-dev-eng] next-audio/video-track patch

Arpi arpi at thot.banki.hu
Wed Oct 29 09:13:34 CET 2003


Hi,

yes it was sent several times and all times refused by .so

> Ooops, this is an ancient patch..  Did anybody have a look at it?
> 
> Diego
> 
> Rüdiger Kuhlmann writes:
>  > Attached the current next-audio/video-track patch, updated to current
>  > mplayer. Thanks for ignoring it for months. It also fixes a segfault and the
>  > unability to package.
>  > 
>  > --- mplayer.c	30 Mar 2003 17:13:04 -0000	1.688
>  > +++ mplayer.c	1 Apr 2003 00:07:25 -0000
>  > @@ -220,6 +220,8 @@
>  >  // streaming:
>  >  int audio_id=-1;
>  >  int video_id=-1;
>  > +int gui_audio_id = -1;
>  > +int gui_video_id = -1;
>  >  int dvdsub_id=-1;
>  >  int vobsub_id=-1;
>  >  static char* audio_lang=NULL;
>  > --- mplayer.h	30 Mar 2003 17:07:30 -0000	1.29
>  > +++ mplayer.h	1 Apr 2003 00:07:26 -0000
>  > @@ -53,8 +53,8 @@
>  >  
>  >  extern int auto_quality;
>  >  
>  > -extern int audio_id;
>  > -extern int video_id;
>  > +extern int audio_id, gui_audio_id;
>  > +extern int video_id, gui_video_id;
>  >  extern int dvdsub_id;
>  >  extern int vobsub_id;
>  >  
>  > --- Gui/app.c	20 Mar 2003 12:41:32 -0000	1.23
>  > +++ Gui/app.c	1 Apr 2003 00:07:26 -0000
>  > @@ -62,7 +62,10 @@
>  >    { evSetURL,		 "evSetURL"	       },
>  >    { evLoadAudioFile,	 "evLoadAudioFile"     },
>  >    { evDropSubtitle,      "evDropSubtitle"      },
>  > -  { evSetAspect,	 "evSetAspect"	       }
>  > +  { evSetAspect,	 "evSetAspect"	       },
>  > +  { evSetAudio,		 "evSetAudio"	       },
>  > +  { evAudioNext, 	 "evAudioNext"	       },
>  > +  { evVideoNext, 	 "evVideoNext"	       }
>  >   };
>  >  
>  >  int evBoxs = sizeof( evNames ) / sizeof( evName );
>  > --- Gui/app.h	20 Mar 2003 12:41:32 -0000	1.18
>  > +++ Gui/app.h	1 Apr 2003 00:07:26 -0000
>  > @@ -61,6 +61,9 @@
>  >  #define evSetVideo	    46
>  >  // 47 ...
>  >  
>  > +#define evAudioNext         99
>  > +#define evVideoNext        100
>  > +
>  >  #define evExit              1000
>  >  
>  >  // --- General events ---
>  > Index: Gui/interface.c
>  > ===================================================================
>  > RCS file: /cvsroot/mplayer/main/Gui/interface.c,v
>  > retrieving revision 1.82
>  > diff -u -r1.82 interface.c
>  > --- Gui/interface.c	20 Mar 2003 12:41:33 -0000	1.82
>  > +++ Gui/interface.c	1 Apr 2003 00:07:26 -0000
>  > @@ -38,7 +38,7 @@
>  >  #include "../libmpdemux/demuxer.h"
>  >  #include "../libmpdemux/stheader.h"
>  >  #include "../libmpcodecs/dec_video.h"
>  > -
>  > +#include "../../codec-cfg.h"
>  >  
>  >  #ifdef NEW_CONFIG
>  >    #include "../m_option.h"
>  > @@ -48,6 +48,8 @@
>  >  #endif
>  >  #include "../cfg-mplayer-def.h"
>  >  
>  > +extern int vcd_track;
>  > +
>  >  guiInterface_t guiIntfStruct;
>  >  int guiWinID=-1;
>  >  
>  > @@ -623,6 +625,7 @@
>  >  	 {
>  >  	  sh_video_t * sh = (sh_video_t *)arg;
>  >  	  guiIntfStruct.FPS=sh->fps;
>  > +	  guiIntfStruct.codecname = sh->codec->name;
>  >  	 }
>  >  
>  >  	if ( guiIntfStruct.NoWindow ) wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow );
>  > Index: Gui/interface.h
>  > ===================================================================
>  > RCS file: /cvsroot/mplayer/main/Gui/interface.h,v
>  > retrieving revision 1.36
>  > diff -u -r1.36 interface.h
>  > --- Gui/interface.h	5 Feb 2003 23:00:44 -0000	1.36
>  > +++ Gui/interface.h	1 Apr 2003 00:07:26 -0000
>  > @@ -109,6 +109,7 @@
>  >     int    AudioFileChanged;
>  >  
>  >     int    SkinChange;
>  > +   char * codecname;
>  >  } guiInterface_t;
>  >  
>  >  extern guiInterface_t guiIntfStruct;
>  > Index: Gui/mplayer/common.c
>  > ===================================================================
>  > RCS file: /cvsroot/mplayer/main/Gui/mplayer/common.c,v
>  > retrieving revision 1.3
>  > diff -u -r1.3 common.c
>  > --- Gui/mplayer/common.c	20 Mar 2003 12:42:09 -0000	1.3
>  > +++ Gui/mplayer/common.c	1 Apr 2003 00:07:26 -0000
>  > @@ -110,12 +110,18 @@
>  >         case 'v': sprintf( tmp,"%3.2f%%",guiIntfStruct.Volume ); strcat( trbuf,tmp ); break;
>  >         case 'V': sprintf( tmp,"%3.1f",guiIntfStruct.Volume ); strcat( trbuf,tmp ); break;
>  >         case 'b': sprintf( tmp,"%3.2f%%",guiIntfStruct.Balance ); strcat( trbuf,tmp ); break;
>  > +       case 'A': if (audio_id == -1) sprintf (tmp, "a"); else sprintf
> (tmp, "%d", audio_id); strcat (trbuf, tmp); break;
>  > +       case 'W': if (video_id == -1) sprintf (tmp, "a"); else sprintf
> (tmp, "%d", video_id); strcat (trbuf, tmp); break;
>  >         case 'B': sprintf( tmp,"%3.1f",guiIntfStruct.Balance ); strcat( trbuf,tmp ); break;
>  >         case 'd': sprintf( tmp,"%d",guiIntfStruct.FrameDrop ); strcat( trbuf,tmp ); break;
>  >         case 'x': sprintf( tmp,"%d",guiIntfStruct.MovieWidth ); strcat( trbuf,tmp ); break;
>  >         case 'y': sprintf( tmp,"%d",guiIntfStruct.MovieHeight ); strcat( trbuf,tmp ); break;
>  > -       case 'C': sprintf( tmp,"%s", guiIntfStruct.sh_video?
> ((sh_video_t *)guiIntfStruct.sh_video)->codec->name : "");
>  > -                 strcat( trbuf,tmp ); break;
>  > +       case 'C': if (guiIntfStruct.codecname) 
>  > +                 {
>  > +                     sprintf (tmp,"%s", guiIntfStruct.codecname);
>  > +                     strcat( trbuf,tmp );
>  > +                 }
>  > +                 break;
>  >         case 's': if ( guiIntfStruct.Playing == 0 ) strcat( trbuf,"s" ); break;
>  >         case 'l': if ( guiIntfStruct.Playing == 1 ) strcat( trbuf,"p" ); break;
>  >         case 'e': if ( guiIntfStruct.Playing == 2 ) strcat( trbuf,"e" ); break;
>  > Index: Gui/mplayer/mw.c
>  > ===================================================================
>  > RCS file: /cvsroot/mplayer/main/Gui/mplayer/mw.c,v
>  > retrieving revision 1.109
>  > diff -u -r1.109 mw.c
>  > --- Gui/mplayer/mw.c	20 Mar 2003 12:42:09 -0000	1.109
>  > +++ Gui/mplayer/mw.c	1 Apr 2003 00:07:26 -0000
>  > @@ -50,7 +50,7 @@
>  >  {
>  >   wItem    * item;
>  >   txSample * image = NULL;
>  > - int        i, type;
>  > + int        i;
>  >  
>  >   if ( appMPlayer.mainWindow.State == wsWindowClosed ) exit_player( MSGTR_Exit_quit );
>  >   
>  > @@ -96,11 +96,43 @@
>  >          gtkShow( evPlayNetwork,NULL );
>  >  	break;
>  >  
>  > +   case evAudioNext:
>  > +        if (!guiIntfStruct.demuxer) break;
>  > +        if (gui_audio_id == -1 && audio_id == -1)
>  > +        {
>  > +          for (gui_audio_id = 0; gui_audio_id < MAX_A_STREAMS; gui_audio_id++)
>  > +            if (((demuxer_t *)guiIntfStruct.demuxer)->a_streams[gui_audio_id])
>  > +              break;
>  > +          gui_audio_id %= MAX_A_STREAMS;
>  > +        }
>  > +        else
>  > +          gui_audio_id = audio_id;
>  > +        for (j = gui_audio_id + 1; j < gui_audio_id + MAX_A_STREAMS; j++)
>  > +          if (((demuxer_t *)guiIntfStruct.demuxer)->a_streams[j % MAX_A_STREAMS])
>  > +            break;
>  > +        iparam = j % MAX_A_STREAMS;
>  > +        /* fall-through */
>  >     case evSetAudio:
>  >          if ( !guiIntfStruct.demuxer || audio_id == iparam ) break;
>  >  	audio_id=iparam;
>  >  	goto play;
>  >  
>  > +   case evVideoNext:
>  > +        if (!guiIntfStruct.demuxer) break;
>  > +        if (gui_video_id == -1 && video_id == -1)
>  > +        {
>  > +          for (gui_video_id = 0; gui_video_id < MAX_A_STREAMS; gui_video_id++)
>  > +            if (((demuxer_t *)guiIntfStruct.demuxer)->v_streams[gui_video_id])
>  > +              break;
>  > +          gui_video_id %= MAX_A_STREAMS;
>  > +        }
>  > +        else
>  > +          gui_video_id = video_id;
>  > +        for (j = gui_video_id + 1; j < gui_video_id + MAX_A_STREAMS; j++)
>  > +          if (((demuxer_t *)guiIntfStruct.demuxer)->v_streams[j % MAX_A_STREAMS])
>  > +            break;
>  > +        iparam = j % MAX_A_STREAMS;
>  > +        /* fall-through */
>  >     case evSetVideo:
>  >          if ( !guiIntfStruct.demuxer || video_id == iparam ) break;
>  >  	video_id=iparam;
>  > --- debian/changelog	15 Feb 2003 15:07:09 -0000	1.31
>  > +++ debian/changelog	1 Apr 2003 00:07:26 -0000
>  > @@ -1,4 +1,4 @@
>  > -mplayer (0.90cvs) unstable; urgency=low
>  > +mplayer (0.90cvs-0) unstable; urgency=low
>  >  
>  >    * this is a placeholder message
>  >  
> 
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> http://mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
> 
> 


A'rpi / Astral & ESP-team

--
Developer of MPlayer G2, the Movie Framework for all - http://www.MPlayerHQ.hu



More information about the MPlayer-dev-eng mailing list