[Mplayer-cvslog] CVS: main/libmpdemux muxer_mpeg.c,1.2,1.3

Alex Beregszaszi alex at mplayerhq.hu
Wed Oct 22 19:07:21 CEST 2003


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

Modified Files:
	muxer_mpeg.c 
Log Message:
update by Andriy N. Gritsenko <andrej at lucky.net>

Index: muxer_mpeg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/muxer_mpeg.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- muxer_mpeg.c	19 Jan 2003 00:33:11 -0000	1.2
+++ muxer_mpeg.c	22 Oct 2003 17:07:17 -0000	1.3
@@ -6,6 +6,7 @@
 
 #include "config.h"
 #include "../version.h"
+#include "../mp_msg.h"
 
 #include "wine/mmreg.h"
 #include "wine/avifmt.h"
@@ -60,23 +61,24 @@
   if (!(s->b_buffer = malloc (MUXER_MPEG_BLOCKSIZE))) {
     free (s);
     return NULL; // no mem?!
-  } else if (type == MUXER_TYPE_VIDEO) {
+  }
+  muxer->streams[muxer->avih.dwStreams]=s;
+  s->type=type;
+  s->id=muxer->avih.dwStreams;
+  s->timer=0.0;
+  s->size=0;
+  s->muxer=muxer;
+  if (type == MUXER_TYPE_VIDEO) {
     s->ckid = be2me_32 (0x1e0 + muxer->num_videos);
     muxer->num_videos++;
     s->h.fccType=streamtypeVIDEO;
     if(!muxer->def_v) muxer->def_v=s;
-//    printf ("Added video stream %d\n", muxer->num_videos);
+    mp_msg (MSGT_MUXER, MSGL_DBG2, "Added video stream %d, ckid=%X\n", muxer->num_videos, s->ckid);
   } else { // MUXER_TYPE_AUDIO
     s->ckid = be2me_32 (0x1c0 + s->id - muxer->num_videos);
     s->h.fccType=streamtypeAUDIO;
-//    printf ("Added audio stream %d\n", s->id - muxer->num_videos + 1);
+    mp_msg (MSGT_MUXER, MSGL_DBG2, "Added audio stream %d, ckid=%X\n", s->id - muxer->num_videos + 1, s->ckid);
   }
-  muxer->streams[muxer->avih.dwStreams]=s;
-  s->type=type;
-  s->id=muxer->avih.dwStreams;
-  s->timer=0.0;
-  s->size=0;
-  s->muxer=muxer;
   muxer->avih.dwStreams++;
   return s;
 }
@@ -119,6 +121,7 @@
   unsigned int mints=0;
   uint16_t l1;
 
+  mp_dbg(MSGT_MUXER, MSGL_DBG3, " MPEG block: size=%u, scr=%u, rate=%u, id=%X;", len, muxer->file_end, muxer->sysrate, s->ckid);
   if (s->b_buffer_ptr == 0) { // 00001111 if no PTS
     s->b_buffer[0] = 0xf;
     s->b_buffer_ptr = 1;
@@ -238,6 +241,7 @@
   }
   else
     dts -= nts/2; // one frame :)
+  mp_dbg(MSGT_MUXER, MSGL_DBG3, ", dts=%u", dts);
   write_mpeg_ts (s->b_buffer+7, dts, 0x10);
 }
 
@@ -316,6 +320,7 @@
     else
       sz = len;
   }
+  mp_dbg(MSGT_MUXER, MSGL_DBG3, "\nMPEG chunk: size=%u, pts=%f", len, s->timer);
   set_mpeg_pts (muxer, s, pts);
   // alter counters:
   if (s->h.dwSampleSize) {
@@ -361,6 +366,7 @@
     memcpy (s->b_buffer+s->b_buffer_ptr, s->buffer+ptr, len);
     s->b_buffer_ptr += len;
   }
+  mp_dbg(MSGT_MUXER, MSGL_DBG3, " next pts=%f\n", s->timer);
 }
 
 static void mpegfile_write_header(muxer_t *muxer){



More information about the MPlayer-cvslog mailing list