--- bitstream.c 2003/12/20 11:54:33 1.39.2.23 +++ bitstream.c 2004/05/02 10:33:22 1.42.2.1 @@ -20,7 +20,7 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: bitstream.c,v 1.39.2.23 2003/12/20 11:54:33 Isibaar Exp $ + * $Id: bitstream.c,v 1.42.2.1 2004/05/02 10:33:22 edgomez Exp $ * ****************************************************************************/ @@ -1196,8 +1196,8 @@ WRITE_MARKER(); if (pParam->fincr>0) { - BitstreamPutBit(bs, 1); /* fixed_vop_rate = 1 */ - BitstreamPutBits(bs, pParam->fincr, log2bin(pParam->fbase-1)); /* fixed_vop_time_increment */ + BitstreamPutBit(bs, 1); /* fixed_vop_rate = 1 */ + BitstreamPutBits(bs, pParam->fincr, MAX(log2bin(pParam->fbase-1),1)); /* fixed_vop_time_increment */ }else{ BitstreamPutBit(bs, 0); /* fixed_vop_rate = 0 */ } @@ -1266,7 +1266,7 @@ BitstreamPadAlways(bs); /* next_start_code(); */ /* fake divx5 id, to ensure compatibility with divx5 decoder */ -#define DIVX5_ID "DivX000b000p" +#define DIVX5_ID "DivX999b000p" if (pParam->max_bframes > 0 && (pParam->global_flags & XVID_GLOBAL_PACKED)) { BitstreamWriteUserData(bs, DIVX5_ID, strlen(DIVX5_ID)); } @@ -1323,8 +1323,7 @@ WRITE_MARKER(); /* time_increment: value=nth_of_sec, nbits = log2(resolution) */ - - BitstreamPutBits(bs, frame->ticks, log2bin(pParam->fbase-1)); + BitstreamPutBits(bs, frame->ticks, MAX(log2bin(pParam->fbase-1), 1)); #if 0 DPRINTF("[%i:%i] %c", frame->seconds, frame->ticks,