# HG changeset patch # User nicodvb # Date 1145569203 0 # Node ID e952e8cdf98e07095116ab7dd1f9c30ffd7fdf01 # Parent 471ccd7705d67a00ade0932f0439264a6264170b removed useless (and broken as hell) buffering code from muxer1; buffering constraints will be fully respected when one of the forthcoming patches is applied diff -r 471ccd7705d6 -r e952e8cdf98e libmpdemux/muxer_mpeg.c --- a/libmpdemux/muxer_mpeg.c Thu Apr 20 20:53:48 2006 +0000 +++ b/libmpdemux/muxer_mpeg.c Thu Apr 20 21:40:03 2006 +0000 @@ -201,15 +201,6 @@ } } -static void fix_buffer_params(muxer_priv_t *priv, uint8_t id, uint32_t size) -{ - uint8_t i; - - for(i = 0; i < priv->sys_info.cnt; i++) - if(priv->sys_info.streams[i].id == id) - priv->sys_info.streams[i].bufsize = size; -} - static inline int is_mpeg1(uint32_t x) { return ( @@ -2019,36 +2010,13 @@ ptr = tmp; } } - - switch (pt) { - case 2: // predictive - if (s->ipb[0]) { - sz = len + s->ipb[0]; - s->ipb[0] = max(s->ipb[0], s->ipb[2]); - s->ipb[2] = 0; - } else if (s->ipb[2]) { - sz = len + s->ipb[2]; - s->ipb[0] = s->ipb[2]; - s->ipb[2] = 0; - } else - sz = 4 * len; // no bidirectional frames yet? - - s->ipb[1] = len; - break; - case 3: // bidirectional - s->ipb[2] += len; - sz = s->ipb[1] + s->ipb[2]; - break; - default: // intra-coded - sz = len; // no extra buffer for it... - } spriv->vframes++; add_frame(spriv, spriv->delta_pts, s->buffer, len, pt, temp_ref); } mp_msg(MSGT_MUXER, MSGL_DBG2,"parse_mpeg12_video, return %u\n", (uint32_t) len); - return sz; + return len; } @@ -2524,15 +2492,6 @@ } - //if genmpeg1/2 and sz > last buffer size in the system header we must write the new sysheader - if(sz > s->h.dwSuggestedBufferSize) { // increase and set STD - s->h.dwSuggestedBufferSize = sz; - if(priv->is_genmpeg1 || priv->is_genmpeg2) { - fix_buffer_params(priv, spriv->id, s->h.dwSuggestedBufferSize); - priv->update_system_header = 1; - } - } - if(spriv->psm_fixed == 0) { add_to_psm(priv, spriv->id, stream_format); spriv->psm_fixed = 1;