[FFmpeg-devel] [PATCH] fix nsvdec.c compilation if DEBUG macro defined

Ronald S. Bultje rsbultje
Tue Feb 15 14:42:31 CET 2011


Hi,

On Tue, Feb 15, 2011 at 6:58 AM, Maksym Veremeyenko <verem at m1stereo.tv> wrote:
> Hi,
>
> compilation of ffmpeg stops on nsvdec.c:
>
> CC ? ? ?libavformat/nsvdec.o
> libavformat/nsvdec.c: In function ?print_tag?:
> libavformat/nsvdec.c:222:5: error: implicit declaration of function
> ?please_use_av_log_instead_of_printf?
> make: *** [libavformat/nsvdec.o] ??????? 1
>
> if configured with option --extra-cflags="-I/usr/local/enctools/include
> -DDEBUG"
>
> attached patch fix debug output in nsvdec.c
[..]

> @@ -249,29 +239,29 @@ static int nsv_resync(AVFormatContext *s)
>          v |= get_byte(pb);
>  /*
>          if (i < 8) {
> -            PRINT(("NSV resync: [%d] = %02x\n", i, v & 0x0FF));
> +            av_dlog(s, "NSV resync: [%d] = %02x\n", i, v & 0x0FF);
>          }
>  */
[..]
> @@ -623,7 +612,7 @@ null_chunk_retry:
>          pkt->flags |= nsv->state == NSV_HAS_READ_NSVS ? AV_PKT_FLAG_KEY : 0; /* keyframe only likely on a sync frame */
>  /*
>          for (i = 0; i < MIN(8, vsize); i++)
> -            PRINT(("NSV video: [%d] = %02x\n", i, pkt->data[i]));
> +            av_dlog(s, "NSV video: [%d] = %02x\n", i, pkt->data[i]);
>  */
>      }
>      if(st[NSV_ST_VIDEO])

gcc is smart enough to remove the loop, so the /* and */ are unnecessary.

> @@ -692,7 +681,7 @@ static int nsv_read_packet(AVFormatContext *s, AVPacket *pkt)
>      /* now pick one of the plates */
>      for (i = 0; i < 2; i++) {
>          if (nsv->ahead[i].data) {
> -                PRINT(("%s: using cached packet[%d]\n", __FUNCTION__, i));
> +                av_dlog(s, "%s: using cached packet[%d]\n", __FUNCTION__, i);
>              /* avoid the cost of new_packet + memcpy(->data) */
>              memcpy(pkt, &nsv->ahead[i], sizeof(AVPacket));
>              nsv->ahead[i].data = NULL; /* we ate that one */

Indent is off.

> @@ -752,7 +741,7 @@ static int nsv_read_close(AVFormatContext *s)
>  static int nsv_probe(AVProbeData *p)
>  {
>      int i;
> -//    PRINT(("nsv_probe(), buf_size %d\n", p->buf_size));
> +//    av_dlog(s, "nsv_probe(), buf_size %d\n", p->buf_size);
>      /* check file header */
>      /* streamed files might not have any header */
>      if (p->buf[0] == 'N' && p->buf[1] == 'S' &&

// is unnecessary obviously.

I've fixed these myself, patch queued.

Ronald



More information about the ffmpeg-devel mailing list