[Mplayer-cvslog] CVS: main/libmpdemux demuxer.c,1.150,1.151 demuxer.h,1.61,1.62 video.c,1.41,1.42

Arpi of Ize arpi at mplayerhq.hu
Sun Aug 24 20:08:57 CEST 2003


Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv24671

Modified Files:
	demuxer.c demuxer.h video.c 
Log Message:
- initial support for MPEG4 in TS (M4V is working, but not AAC yet)
patch by Nico <nsabbi at libero.it>


Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.c,v
retrieving revision 1.150
retrieving revision 1.151
diff -u -r1.150 -r1.151
--- demuxer.c	7 Aug 2003 12:40:14 -0000	1.150
+++ demuxer.c	24 Aug 2003 18:08:54 -0000	1.151
@@ -216,6 +216,7 @@
       demux_close_gif(demuxer); break;
 #endif
     case DEMUXER_TYPE_MPEG_TS:
+    case DEMUXER_TYPE_MPEG4_IN_TS:
       demux_close_ts(demuxer); break;
     case DEMUXER_TYPE_REALAUDIO:
       demux_close_ra(demuxer); break;
@@ -358,7 +359,9 @@
 #ifdef HAVE_GIF
     case DEMUXER_TYPE_GIF: return demux_gif_fill_buffer(demux);
 #endif
-    case DEMUXER_TYPE_MPEG_TS: return demux_ts_fill_buffer(demux);
+    case DEMUXER_TYPE_MPEG_TS: 
+    case DEMUXER_TYPE_MPEG4_IN_TS: 
+	return demux_ts_fill_buffer(demux);
     case DEMUXER_TYPE_REALAUDIO: return demux_ra_fill_buffer(demux);
   }
   return 0;
@@ -1259,7 +1262,8 @@
    break;
  }
 #endif
- case DEMUXER_TYPE_MPEG_TS: {
+ case DEMUXER_TYPE_MPEG_TS: 
+ case DEMUXER_TYPE_MPEG4_IN_TS: {
   demux_open_ts(demuxer);
   break;
  }
@@ -1462,6 +1466,7 @@
       demux_mkv_seek(demuxer,rel_seek_secs,flags);  break;
 #endif
  case DEMUXER_TYPE_MPEG_TS:
+ case DEMUXER_TYPE_MPEG4_IN_TS:
       demux_seek_ts(demuxer,rel_seek_secs,flags); break;
 
 } // switch(demuxer->file_format)
@@ -1533,6 +1538,8 @@
 	case DEMUXER_TYPE_MPEG4_ES:
 	case DEMUXER_TYPE_MPEG_ES:
 	case DEMUXER_TYPE_MPEG_PS:
+	case DEMUXER_TYPE_MPEG_TS:
+	case DEMUXER_TYPE_MPEG4_IN_TS:
 	    return demux_mpg_control(demuxer,cmd,arg);
 	case DEMUXER_TYPE_ASF:
 	    return demux_asf_control(demuxer,cmd,arg);

Index: demuxer.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.h,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- demuxer.h	9 Jun 2003 00:24:22 -0000	1.61
+++ demuxer.h	24 Aug 2003 18:08:54 -0000	1.62
@@ -42,6 +42,7 @@
 #define DEMUXER_TYPE_MATROSKA 31
 #define DEMUXER_TYPE_REALAUDIO 32
 #define DEMUXER_TYPE_MPEG_TY 33
+#define DEMUXER_TYPE_MPEG4_IN_TS 34
 
 // This should always match the higest demuxer type number.
 // Unless you want to disallow users to force the demuxer to some types
@@ -153,6 +154,21 @@
   dp->buffer=len?(unsigned char*)malloc(len+8):NULL;
   if(len) memset(dp->buffer+len,0,8);
   return dp;
+}
+
+inline static void resize_demux_packet(demux_packet_t* dp, int len)
+{
+  if(len)
+  {
+     dp->buffer=(unsigned char *)realloc(dp->buffer,len+8);
+     memset(dp->buffer+len,0,8);
+  }
+  else
+  {
+     if(dp->buffer) free(dp->buffer);
+     dp->buffer=NULL;
+  }
+  dp->len=len;
 }
 
 inline static demux_packet_t* clone_demux_packet(demux_packet_t* pack){

Index: video.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/video.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- video.c	15 Jul 2003 07:19:03 -0000	1.41
+++ video.c	24 Aug 2003 18:08:54 -0000	1.42
@@ -86,7 +86,8 @@
 #endif
   break;
  }
- case DEMUXER_TYPE_MPEG4_ES: {
+ case DEMUXER_TYPE_MPEG4_ES: 
+ case DEMUXER_TYPE_MPEG4_IN_TS: {
    videobuf_len=0; videobuf_code_len=0;
    mp_msg(MSGT_DECVIDEO,MSGL_V,"Searching for Video Object Start code... ");fflush(stdout);
    while(1){
@@ -410,7 +411,7 @@
 	    telecine=1;
 	}
 
-  } else if(demuxer->file_format==DEMUXER_TYPE_MPEG4_ES){
+  } else if((demuxer->file_format==DEMUXER_TYPE_MPEG4_ES) || (demuxer->file_format==DEMUXER_TYPE_MPEG4_IN_TS)){
       //
         while(videobuf_len<VIDEOBUFFER_SIZE-MAX_VIDEO_PACKET_SIZE){
           int i=sync_video_packet(d_video);



More information about the MPlayer-cvslog mailing list