[MPlayer-cvslog] r21547 - in trunk: libmpcodecs/ad_hwmpa.c libmpcodecs/ae_pcm.c libmpcodecs/vd_ffmpeg.c libmpcodecs/ve_x264.c libmpdemux/aviheader.h libmpdemux/demux_mpg.c libmpdemux/demux_ogg.c libmpdemux/demux_ts.c libmpdemux/demux_vqf.c libmpdemux/muxer_mpeg.c
reimar
subversion at mplayerhq.hu
Sat Dec 9 13:24:13 CET 2006
Author: reimar
Date: Sat Dec 9 13:24:11 2006
New Revision: 21547
Modified:
trunk/libmpcodecs/ad_hwmpa.c
trunk/libmpcodecs/ae_pcm.c
trunk/libmpcodecs/vd_ffmpeg.c
trunk/libmpcodecs/ve_x264.c
trunk/libmpdemux/aviheader.h
trunk/libmpdemux/demux_mpg.c
trunk/libmpdemux/demux_ogg.c
trunk/libmpdemux/demux_ts.c
trunk/libmpdemux/demux_vqf.c
trunk/libmpdemux/muxer_mpeg.c
Log:
Get rid of min/max macros from aviheader.h, they do not belong here.
Replace their uses by FFMIN/FFMAX
Modified: trunk/libmpcodecs/ad_hwmpa.c
==============================================================================
--- trunk/libmpcodecs/ad_hwmpa.c (original)
+++ trunk/libmpcodecs/ad_hwmpa.c Sat Dec 9 13:24:11 2006
@@ -96,7 +96,7 @@
if(start + len > sh->a_in_buffer_len)
{
int l;
- l = min(sh->a_in_buffer_size - sh->a_in_buffer_len, start + len);
+ l = FFMIN(sh->a_in_buffer_size - sh->a_in_buffer_len, start + len);
l = demux_read_data(sh->ds,&sh->a_in_buffer[sh->a_in_buffer_len], l);
if(! l)
break;
Modified: trunk/libmpcodecs/ae_pcm.c
==============================================================================
--- trunk/libmpcodecs/ae_pcm.c (original)
+++ trunk/libmpcodecs/ae_pcm.c Sat Dec 9 13:24:11 2006
@@ -36,7 +36,7 @@
static int encode_pcm(audio_encoder_t *encoder, uint8_t *dest, void *src, int nsamples, int max_size)
{
- max_size = min(nsamples, max_size);
+ max_size = FFMIN(nsamples, max_size);
memcpy(dest, src, max_size);
return max_size;
}
Modified: trunk/libmpcodecs/vd_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/vd_ffmpeg.c (original)
+++ trunk/libmpcodecs/vd_ffmpeg.c Sat Dec 9 13:24:11 2006
@@ -392,11 +392,11 @@
if (sh->bih->biSize-sizeof(BITMAPINFOHEADER))
/* Palette size in biSize */
memcpy(avctx->palctrl->palette, sh->bih+1,
- min(sh->bih->biSize-sizeof(BITMAPINFOHEADER), AVPALETTE_SIZE));
+ FFMIN(sh->bih->biSize-sizeof(BITMAPINFOHEADER), AVPALETTE_SIZE));
else
/* Palette size in biClrUsed */
memcpy(avctx->palctrl->palette, sh->bih+1,
- min(sh->bih->biClrUsed * 4, AVPALETTE_SIZE));
+ FFMIN(sh->bih->biClrUsed * 4, AVPALETTE_SIZE));
}
if(sh->bih)
Modified: trunk/libmpcodecs/ve_x264.c
==============================================================================
--- trunk/libmpcodecs/ve_x264.c (original)
+++ trunk/libmpcodecs/ve_x264.c Sat Dec 9 13:24:11 2006
@@ -124,7 +124,7 @@
if(turbo == 1)
{
param.i_frame_reference = ( param.i_frame_reference + 1 ) >> 1;
- param.analyse.i_subpel_refine = max( min( 3, param.analyse.i_subpel_refine - 1 ), 1 );
+ param.analyse.i_subpel_refine = FFMAX( FFMIN( 3, param.analyse.i_subpel_refine - 1 ), 1 );
param.analyse.inter &= ( ~X264_ANALYSE_PSUB8x8 );
param.analyse.inter &= ( ~X264_ANALYSE_BSUB16x16 );
param.analyse.i_trellis = 0;
Modified: trunk/libmpdemux/aviheader.h
==============================================================================
--- trunk/libmpdemux/aviheader.h (original)
+++ trunk/libmpdemux/aviheader.h Sat Dec 9 13:24:11 2006
@@ -5,18 +5,6 @@
#include "libavutil/common.h"
#include "mpbswap.h"
-#ifndef MIN
-#define MIN(a,b) (((a)<(b))?(a):(b))
-#endif
-
-#ifndef min
-#define min(a,b) (((a)<(b))?(a):(b))
-#endif
-
-#ifndef max
-#define max(a,b) (((a)>(b))?(a):(b))
-#endif
-
#ifndef mmioFOURCC
#define mmioFOURCC( ch0, ch1, ch2, ch3 ) \
( (uint32_t)(uint8_t)(ch0) | ( (uint32_t)(uint8_t)(ch1) << 8 ) | \
Modified: trunk/libmpdemux/demux_mpg.c
==============================================================================
--- trunk/libmpdemux/demux_mpg.c (original)
+++ trunk/libmpdemux/demux_mpg.c Sat Dec 9 13:24:11 2006
@@ -57,7 +57,7 @@
prog_len = stream_read_word(demux->stream); //length of program descriptors
stream_skip(demux->stream, prog_len); //.. that we ignore
es_map_len = stream_read_word(demux->stream); //length of elementary streams map
- es_map_len = min(es_map_len, len - prog_len - 8); //sanity check
+ es_map_len = FFMIN(es_map_len, len - prog_len - 8); //sanity check
while(es_map_len > 0) {
type = stream_read_char(demux->stream);
id = stream_read_char(demux->stream);
@@ -91,7 +91,7 @@
mp_dbg(MSGT_DEMUX,MSGL_V, "PSM ES, id=0x%x, type=%x, stype: %x\n", id, type, priv->es_map[idoffset]);
}
plen = stream_read_word(demux->stream); //length of elementary stream descriptors
- plen = min(plen, es_map_len); //sanity check
+ plen = FFMIN(plen, es_map_len); //sanity check
stream_skip(demux->stream, plen); //skip descriptors for now
es_map_len -= 4 + plen;
}
Modified: trunk/libmpdemux/demux_ogg.c
==============================================================================
--- trunk/libmpdemux/demux_ogg.c (original)
+++ trunk/libmpdemux/demux_ogg.c Sat Dec 9 13:24:11 2006
@@ -593,7 +593,7 @@
stream_seek(s,demuxer->movi_start);
} else {
//the 270000 are just a wild guess
- stream_seek(s,max(ogg_d->pos,demuxer->movi_end-270000));
+ stream_seek(s,FFMAX(ogg_d->pos,demuxer->movi_end-270000));
}
ogg_sync_reset(sync);
Modified: trunk/libmpdemux/demux_ts.c
==============================================================================
--- trunk/libmpdemux/demux_ts.c (original)
+++ trunk/libmpdemux/demux_ts.c Sat Dec 9 13:24:11 2006
@@ -1174,7 +1174,7 @@
while(i < sl->ts_len)
{
- m = min(8, sl->ts_len - i);
+ m = FFMIN(8, sl->ts_len - i);
v |= getbits(buf, n, m);
if(sl->ts_len - i > 8)
v <<= 8;
@@ -1193,7 +1193,7 @@
pl_size = 0;
while(i < sl->au_len)
{
- m = min(8, sl->au_len - i);
+ m = FFMIN(8, sl->au_len - i);
pl_size |= getbits(buf, n, m);
if(sl->au_len - i > 8)
pl_size <<= 8;
@@ -1662,7 +1662,7 @@
int i = 0, j, size = 0;
mp_msg(MSGT_DEMUX, MSGL_DBG2, "PARSE_MP4_DESC_LEN(%d), bytes: ", *len);
- j = min(*len, 4);
+ j = FFMIN(*len, 4);
while(i < j)
{
mp_msg(MSGT_DEMUX, MSGL_DBG2, " %x ", buf[i]);
@@ -2957,7 +2957,7 @@
if(tss->payload_size > 0)
{
- sz = min(tss->payload_size, buf_size);
+ sz = FFMIN(tss->payload_size, buf_size);
tss->payload_size -= sz;
es->size = sz;
}
Modified: trunk/libmpdemux/demux_vqf.c
==============================================================================
--- trunk/libmpdemux/demux_vqf.c (original)
+++ trunk/libmpdemux/demux_vqf.c Sat Dec 9 13:24:11 2006
@@ -98,31 +98,31 @@
memcpy(sdata,&buf[i],slen); sdata[slen]=0; i+=slen;
if(sid==mmioFOURCC('N','A','M','E'))
{
- memcpy(hi->Name,sdata,min(BUFSIZ,slen));
+ memcpy(hi->Name,sdata,FFMIN(BUFSIZ,slen));
demux_info_add(demuxer,"Title",sdata);
}
else
if(sid==mmioFOURCC('A','U','T','H'))
{
- memcpy(hi->Auth,sdata,min(BUFSIZ,slen));
+ memcpy(hi->Auth,sdata,FFMIN(BUFSIZ,slen));
demux_info_add(demuxer,"Author",sdata);
}
else
if(sid==mmioFOURCC('C','O','M','T'))
{
- memcpy(hi->Comt,sdata,min(BUFSIZ,slen));
+ memcpy(hi->Comt,sdata,FFMIN(BUFSIZ,slen));
demux_info_add(demuxer,"Comment",sdata);
}
else
if(sid==mmioFOURCC('(','c',')',' '))
{
- memcpy(hi->Cpyr,sdata,min(BUFSIZ,slen));
+ memcpy(hi->Cpyr,sdata,FFMIN(BUFSIZ,slen));
demux_info_add(demuxer,"Copyright",sdata);
}
else
if(sid==mmioFOURCC('F','I','L','E'))
{
- memcpy(hi->File,sdata,min(BUFSIZ,slen));
+ memcpy(hi->File,sdata,FFMIN(BUFSIZ,slen));
}
else
if(sid==mmioFOURCC('A','L','B','M')) demux_info_add(demuxer,"Album",sdata);
Modified: trunk/libmpdemux/muxer_mpeg.c
==============================================================================
--- trunk/libmpdemux/muxer_mpeg.c (original)
+++ trunk/libmpdemux/muxer_mpeg.c Sat Dec 9 13:24:11 2006
@@ -936,7 +936,7 @@
{
if(!frpos && len>0 && s->type == MUXER_TYPE_VIDEO && spriv->framebuf[n].type==I_FRAME)
return len;
- m = min(spriv->framebuf[n].size - frpos, psize - len);
+ m = FFMIN(spriv->framebuf[n].size - frpos, psize - len);
len += m;
frpos += m;
if(frpos == spriv->framebuf[n].size)
@@ -997,8 +997,8 @@
if(i > -1)
{
- dpts = max(spriv->last_saved_pts, spriv->framebuf[i].pts) -
- min(spriv->last_saved_pts, spriv->framebuf[i].pts) +
+ dpts = FFMAX(spriv->last_saved_pts, spriv->framebuf[i].pts) -
+ FFMIN(spriv->last_saved_pts, spriv->framebuf[i].pts) +
spriv->framebuf[0].idur;
if(s->type != MUXER_TYPE_VIDEO)
@@ -1218,7 +1218,7 @@
update_demux_bufsize(spriv, frm->dts, frm->size, s->type);
}
- m = min(frm->size - frm->pos, priv->packet_size - spriv->pack_offset);
+ m = FFMIN(frm->size - frm->pos, priv->packet_size - spriv->pack_offset);
memcpy(&(spriv->pack[spriv->pack_offset]), &(frm->buffer[frm->pos]), m);
len += m;
@@ -2215,7 +2215,7 @@
{
stream->ckid = be2me_32 (0x1bd);
if(priv->is_genmpeg1 || priv->is_genmpeg2)
- fix_audio_sys_header(priv, spriv->id, 0xbd, max(conf_abuf_size, 58)*1024); //only one audio at the moment
+ fix_audio_sys_header(priv, spriv->id, 0xbd, FFMAX(conf_abuf_size, 58)*1024); //only one audio at the moment
spriv->id = 0xbd;
if(!conf_abuf_size)
spriv->max_buffer_size = 16*1024;
More information about the MPlayer-cvslog
mailing list