diff options
author | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-10-22 17:07:17 +0000 |
---|---|---|
committer | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-10-22 17:07:17 +0000 |
commit | 6ffaf41f455252ca9319ba5ba10932d0485337d6 (patch) | |
tree | 02c9947aa05955bf1098f8ecb633b38ed356dcca | |
parent | b32c67928a94f0c31e97eb773f139478e006ef0a (diff) |
update by Andriy N. Gritsenko <andrej@lucky.net>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11224 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libmpdemux/muxer_mpeg.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/libmpdemux/muxer_mpeg.c b/libmpdemux/muxer_mpeg.c index 96d2d4be48..2c40bc45dc 100644 --- a/libmpdemux/muxer_mpeg.c +++ b/libmpdemux/muxer_mpeg.c @@ -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 @@ static muxer_stream_t* mpegfile_new_stream(muxer_t *muxer,int type){ 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 @@ static int write_mpeg_block(muxer_t *muxer, muxer_stream_t *s, FILE *f, char *bl 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 @@ static void set_mpeg_pts(muxer_t *muxer, muxer_stream_t *s, unsigned int pts) { } 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 @@ static void mpegfile_write_chunk(muxer_stream_t *s,size_t len,unsigned int flags 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 @@ static void mpegfile_write_chunk(muxer_stream_t *s,size_t len,unsigned int flags 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){ |