Steve Lhomme | 1 Mar 2006 01:57

[PATCH] remove most of fprintf

...and replace with av_log()

Index: libavcodec/cook.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/cook.c,v
retrieving revision 1.9
diff -u -r1.9 cook.c
--- libavcodec/cook.c	10 Feb 2006 11:59:38 -0000	1.9
+++ libavcodec/cook.c	1 Mar 2006 00:19:19 -0000
 <at>  <at>  -1275,16 +1275,16  <at>  <at> 
 
     /* Try to catch some obviously faulty streams, othervise it might be exploitable */
     if (q->total_subbands > 53) {
-        av_log(NULL,AV_LOG_ERROR,"total_subbands > 53, report sample!\n");
+        av_log(avctx,AV_LOG_ERROR,"total_subbands > 53, report sample!\n");
         return -1;
     }
     if (q->subbands > 50) {
-        av_log(NULL,AV_LOG_ERROR,"subbands > 50, report sample!\n");
+        av_log(avctx,AV_LOG_ERROR,"subbands > 50, report sample!\n");
         return -1;
     }
     if ((q->samples_per_channel == 256) || (q->samples_per_channel == 512) || (q->samples_per_channel ==
1024)) {
     } else {
-        av_log(NULL,AV_LOG_ERROR,"unknown amount of samples_per_channel = %d, report sample!\n",q->samples_per_channel);
+        av_log(avctx,AV_LOG_ERROR,"unknown amount of samples_per_channel = %d, report sample!\n",q->samples_per_channel);
         return -1;
(Continue reading)

Panayotis Katsaloulis | 1 Mar 2006 02:08
Favicon

proposed configure patch for better detection of cross-platform compilers

Hello

Here I propose this patch, in order for the ./configure script to
better detect if a cross platform compiler is used:

--- configure   2006-03-01 02:46:30.000000000 +0200
+++ configure.old       2006-03-01 02:46:05.000000000 +0200
 <at>  <at>  -939,7 +939,7  <at>  <at> 
 ranlib="${cross_prefix}${ranlib}"
 strip="${cross_prefix}${strip}"

-if test -z "$cross_prefix" -a "$cpu" = "`uname -m`"; then
+if test -z "$cross_prefix" ; then

 # ---
 # big/little-endian test

The reason I am applying for this is, in macosx the compiler has
exactly the same name for both architects, only the "-arch XXX"
parameter differs.
Although I can bypass this with the --extra-cflags option, the script
can not properly detect whether the target platform is big or little
endian.
This patch (hopefully) fixes this issue.

Thank you

--
Δεν περιμένω τίποτε παρά μόνο όσα εγώ προκαλώ
(Continue reading)

Steve Lhomme | 1 Mar 2006 02:07

[PATCH] use intptr_t

...where it makes sense (ie where I found possible problems).
Index: libavcodec/dv.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/dv.c,v
retrieving revision 1.81
diff -u -r1.81 dv.c
--- libavcodec/dv.c	28 Feb 2006 02:54:48 -0000	1.81
+++ libavcodec/dv.c	1 Mar 2006 01:04:43 -0000
 <at>  <at>  -390,8 +390,8  <at>  <at> 
     DECLARE_ALIGNED_8(uint8_t, vs_bit_buffer[5 * 80 + 4]); /* allow some slack */
     const int log2_blocksize= 3-s-≥avctx->lowres;
 
-    assert((((int)mb_bit_buffer)&7)==0);
-    assert((((int)vs_bit_buffer)&7)==0);
+    assert((((intptr_t)mb_bit_buffer)&7)==0);
+    assert((((intptr_t)vs_bit_buffer)&7)==0);
 
     memset(sblock, 0, sizeof(sblock));
 
 <at>  <at>  -837,7 +837,7  <at>  <at> 
     int       vs_bit_size = 0;
     int       qnos[5];
 
-    assert((((int)block) & 7) == 0);
+    assert((((intptr_t)block) & 7) == 0);
 
     enc_blk = &enc_blks[0];
     pb = &pbs[0];
(Continue reading)

Steve Lhomme | 1 Mar 2006 02:20

[PATCH] win32 can also exit properly

...when you press the 'q' key. It works win MinGW (and MSVC).
Index: ffmpeg.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/ffmpeg.c,v
retrieving revision 1.370
diff -u -r1.370 ffmpeg.c
--- ffmpeg.c	28 Feb 2006 11:32:31 -0000	1.370
+++ ffmpeg.c	1 Mar 2006 01:17:26 -0000
 <at>  <at>  -386,31 +386,32  <at>  <at> 
     return -1;
 }
 
-static int decode_interrupt_cb(void)
-{
-    return q_pressed || (q_pressed = read_key() == 'q');
-}
-
 #else
 
+#include <conio.h>
+
 static volatile int received_sigterm = 0;
 
 /* no interactive support */
-static void term_exit(void)
-{
-}
+#define term_exit()
(Continue reading)

Steve Lhomme | 1 Mar 2006 02:22

Re: [PATCH] remove most of fprintf

OK, you can change the name of this patch to "log cleaning". As it 
handles printf, fprintf and av_log parameters (not NULL when available).

Steve Lhomme wrote:
> ...and replace with av_log()
Steve Lhomme | 1 Mar 2006 02:33

[PATCH] GUID is defined in the Windows API (DirectShow)

...so this patch renames libavformat's GUID to wGUID. Feel free to 
rename it to something better if you need.
Index: libavformat/asf-enc.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/asf-enc.c,v
retrieving revision 1.76
diff -u -r1.76 asf-enc.c
--- libavformat/asf-enc.c	12 Jan 2006 22:43:21 -0000	1.76
+++ libavformat/asf-enc.c	1 Mar 2006 01:28:14 -0000
 <at>  <at>  -191,7 +191,7  <at>  <at> 
 
 static const uint8_t error_spread_ADPCM_G726[] = { 0x01, 0x90, 0x01, 0x90, 0x01, 0x01, 0x00, 0x00 };
 
-static void put_guid(ByteIOContext *s, const GUID *g)
+static void put_guid(ByteIOContext *s, const wGUID *g)
 {
     int i;
 
 <at>  <at>  -227,7 +227,7  <at>  <at> 
     }
 }
 
-static int64_t put_header(ByteIOContext *pb, const GUID *g)
+static int64_t put_header(ByteIOContext *pb, const wGUID *g)
 {
     int64_t pos;
 
Index: libavformat/asf.c
(Continue reading)

Steve Lhomme | 1 Mar 2006 02:42

[PATCH] near is a special keyword

...on some windows compilers (far vs near pointers). So I renamed items 
called "near".
Index: libavcodec/jpeg_ls.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/jpeg_ls.c,v
retrieving revision 1.5
diff -u -r1.5 jpeg_ls.c
--- libavcodec/jpeg_ls.c	2 Feb 2006 02:36:27 -0000	1.5
+++ libavcodec/jpeg_ls.c	1 Mar 2006 01:38:20 -0000
 <at>  <at>  -34,7 +34,7  <at>  <at> 
     int T1, T2, T3;
     int A[367], B[367], C[365], N[367];
     int limit, reset, bpp, qbpp, maxval, range;
-    int near, twonear;
+    int onenear, twonear;
     int run_index[3];
 }JLSState;
 
 <at>  <at>  -63,7 +63,7  <at>  <at> 
 static void ls_init_state(JLSState *state){
     int i;
 
-    state->twonear = state->near * 2 + 1;
+    state->twonear = state->onenear * 2 + 1;
     state->range = ((state->maxval + state->twonear - 1) / state->twonear) + 1;
 
     // QBPP = ceil(log2(RANGE))
 <at>  <at>  -92,10 +92,10  <at>  <at> 
(Continue reading)

Michael Niedermayer | 1 Mar 2006 02:56
Picon
Picon

Re: [PATCH] remove most of fprintf

Hi

On Tue, Feb 28, 2006 at 02:57:41PM -1000, Steve Lhomme wrote:
> ...and replace with av_log()
> 

[...]

> Index: libavcodec/huffyuv.c
> ===================================================================
> RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/huffyuv.c,v
> retrieving revision 1.66
> diff -u -r1.66 huffyuv.c
> --- libavcodec/huffyuv.c	25 Jan 2006 22:10:12 -0000	1.66
> +++ libavcodec/huffyuv.c	1 Mar 2006 00:26:14 -0000
>  <at>  <at>  -343,7 +343,7  <at>  <at> 
>  
>      return 0;
>  #else
> -    fprintf(stderr, "v1 huffyuv is not supported \n");
> +    av_log(s->avctx, AV_LOG_DEBUG, "v1 huffyuv is not supported \n");

AV_LOG_ERROR!

[...]

> Index: libavcodec/motion_est.c
> ===================================================================
> RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/motion_est.c,v
> retrieving revision 1.120
(Continue reading)

Michael Niedermayer | 1 Mar 2006 03:01
Picon
Picon

Re: [PATCH] GUID is defined in the Windows API (DirectShow)

Hi

On Tue, Feb 28, 2006 at 03:33:07PM -1000, Steve Lhomme wrote:
> ...so this patch renames libavformat's GUID to wGUID. Feel free to 
> rename it to something better if you need.

put
#define GUID microsuck_GUID
around the #inlcude
#undef

or something similar

[...]

--

-- 
Michael
Michael Niedermayer | 1 Mar 2006 03:07
Picon
Picon

Re: [PATCH] near is a special keyword

Hi

On Tue, Feb 28, 2006 at 03:42:26PM -1000, Steve Lhomme wrote:
> ...on some windows compilers (far vs near pointers). So I renamed items 
> called "near".

#define near smallandstinkingsoft_not_knowing_c_standard

[...]

--

-- 
Michael

Gmane