Revision 593bb98d

View differences:

libavformat/udp.c
67 67
    sem_t circular_buffer_semaphore;
68 68
} UDPContext;
69 69

  
70
#define min(X,Y)                ((X)<(Y) ? (X):(Y))
71
#define max(X,Y)                ((X)>(Y) ? (X):(Y))
72

  
73 70
#define UDP_TX_BUF_SIZE 32768
74 71
#define UDP_MAX_PKT_SIZE 65536
75 72

  
......
351 348
        left = s->circular_buffer_size-s->circular_buffer_head;
352 349
        /* Whats the minimum we can read so that we dont comletely fill the buffer */
353 350
        sem_wait( &s->circular_buffer_semaphore);
354
        left = min( left, s->circular_buffer_size-s->circular_buffer_available);
351
        left = FFMIN( left, s->circular_buffer_size-s->circular_buffer_available);
355 352
        sem_post( &s->circular_buffer_semaphore );
356 353
        /* No Space left, error, what do we do now */
357 354
        if( !left) {
......
369 366
        s->circular_buffer_head += len;
370 367
        sem_wait( &s->circular_buffer_semaphore);
371 368
        s->circular_buffer_available += len;
372
        s->circular_buffer_available_max = max( s->circular_buffer_available_max, s->circular_buffer_available);
369
        s->circular_buffer_available_max = FFMAX( s->circular_buffer_available_max, s->circular_buffer_available);
373 370
        sem_post( &s->circular_buffer_semaphore );
374 371
        if( s->circular_buffer_head>=s->circular_buffer_size)
375 372
            s->circular_buffer_head -= s->circular_buffer_size;
......
560 557
            if (avail) { // >=size) {
561 558

  
562 559
                // Maximum amount available
563
                size = min( avail, size);
560
                size = FFMIN( avail, size);
564 561
                // Whats left till the end of the circular buffer
565 562
                left = s->circular_buffer_size-s->circular_buffer_tail;
566 563
                // How much do we need, all?
567
                left = min( left, size);
564
                left = FFMIN( left, size);
568 565
                // Get the first block
569 566
                memcpy( buf, s->circular_buffer+s->circular_buffer_tail, left);
570 567
                // Have we any more, this will be from the start of the buffer

Also available in: Unified diff