changeset 10687:f8d6f7d59ceb

- initial support for MPEG4 in TS (M4V is working, but not AAC yet) patch by Nico <nsabbi@libero.it>
author arpi
date Sun, 24 Aug 2003 18:08:54 +0000
parents 8eb690f0e342
children c2331e3ef96a
files libmpdemux/demuxer.c libmpdemux/demuxer.h libmpdemux/video.c
diffstat 3 files changed, 28 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demuxer.c	Sun Aug 24 18:07:00 2003 +0000
+++ b/libmpdemux/demuxer.c	Sun Aug 24 18:08:54 2003 +0000
@@ -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);
--- a/libmpdemux/demuxer.h	Sun Aug 24 18:07:00 2003 +0000
+++ b/libmpdemux/demuxer.h	Sun Aug 24 18:08:54 2003 +0000
@@ -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
@@ -155,6 +156,21 @@
   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){
   demux_packet_t* dp=(demux_packet_t*)malloc(sizeof(demux_packet_t));
   while(pack->master) pack=pack->master; // find the master
--- a/libmpdemux/video.c	Sun Aug 24 18:07:00 2003 +0000
+++ b/libmpdemux/video.c	Sun Aug 24 18:08:54 2003 +0000
@@ -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);