[Mplayer-cvslog] CVS: main mplayer.c,1.83,1.84 demux_mpg.c,1.14,1.15 demuxer.c,1.3,1.4

GEREOFFY arpi_esp at users.sourceforge.net
Sat Apr 21 01:00:14 CEST 2001


Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv9735

Modified Files:
	mplayer.c demux_mpg.c demuxer.c 
Log Message:
dvd sub parser move dto mplayer.c

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -C2 -r1.83 -r1.84
*** mplayer.c	2001/04/20 22:35:14	1.83
--- mplayer.c	2001/04/20 23:00:11	1.84
***************
*** 290,293 ****
--- 290,294 ----
  demux_stream_t *d_audio=NULL;
  demux_stream_t *d_video=NULL;
+ demux_stream_t *d_dvdsub=NULL;
  
  sh_audio_t *sh_audio=NULL;//&sh_audio_i;
***************
*** 709,712 ****
--- 710,714 ----
  d_audio=demuxer->audio;
  d_video=demuxer->video;
+ d_dvdsub=demuxer->sub;
  //d_audio->sh=sh_audio; 
  //d_video->sh=sh_video; 
***************
*** 2040,2043 ****
--- 2042,2054 ----
        current_module=NULL;
    }
+   
+   // DVD sub:
+   { unsigned char* buf=NULL;
+     int len=ds_get_packet_sub(d_dvdsub,&buf);
+     if(len>0){
+        printf("\rDVD sub: %d   \n",len);
+     }
+   }
+   
  }
  

Index: demux_mpg.c
===================================================================
RCS file: /cvsroot/mplayer/main/demux_mpg.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** demux_mpg.c	2001/04/20 22:35:15	1.14
--- demux_mpg.c	2001/04/20 23:00:11	1.15
***************
*** 4,10 ****
  #define MAX_PS_PACKETSIZE (224*1024)
  
! static void parse_dvdsub(unsigned char *buf,int len){
!     printf("\rDVDsub packet: %d  \n",len);
! }
  
  static int mpeg_pts_error=0;
--- 4,10 ----
  #define MAX_PS_PACKETSIZE (224*1024)
  
! //static void parse_dvdsub(unsigned char *buf,int len){
! //    printf("\rDVDsub packet: %d  \n",len);
! //}
  
  static int mpeg_pts_error=0;
***************
*** 227,231 ****
  #endif
      ds_read_packet(ds,demux->stream,len,pts/90000.0f,0);
!     if(ds==demux->sub) parse_dvdsub(ds->last->buffer,ds->last->len);
      return 1;
    }
--- 227,231 ----
  #endif
      ds_read_packet(ds,demux->stream,len,pts/90000.0f,0);
! //    if(ds==demux->sub) parse_dvdsub(ds->last->buffer,ds->last->len);
      return 1;
    }
***************
*** 290,294 ****
    if(demux->synced==2){
        ret=demux_mpg_read_packet(demux,head);
- /*
        if(!ret)
          if(--max_packs==0){
--- 290,293 ----
***************
*** 297,301 ****
            return 0;
          }
- */
    } else {
      if(head>=0x100 && head<0x1B0){
--- 296,299 ----

Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/demuxer.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** demuxer.c	2001/04/20 22:35:15	1.3
--- demuxer.c	2001/04/20 23:00:11	1.4
***************
*** 290,291 ****
--- 290,307 ----
      }
  }
+ 
+ int ds_get_packet_sub(demux_stream_t *ds,char **start){
+     while(1){
+         int len;
+         if(ds->buffer_pos>=ds->buffer_size){
+           *start = NULL;
+           if(!ds->packs) return -1; // no sub
+           if(!ds_fill_buffer(ds)) return -1; // EOF
+         }
+         len=ds->buffer_size-ds->buffer_pos;
+         *start = &ds->buffer[ds->buffer_pos];
+         ds->buffer_pos+=len;
+         return len;
+     }
+ }
+ 


_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog



More information about the MPlayer-cvslog mailing list