From a50b7562804e4b3e3935b4843dcbb0e48a3d1cf8 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 20 Jun 2012 18:36:14 +0200 Subject: lavc: remove stats_in from AVCodecContext options table. Its documentation states that it is allocated/freed by the caller, but it is declared as an AV_OPT_TYPE_STRING AVOption. Since 367732832faaf1bac4ece37cf7fef8c911e16312 the AVOptions system frees strings automatically. This can be considered an API break, since it won't work when the caller doesn't use av_malloc() to allocate the memory or wants to use the string after closing the codec. Since there is not much value in this field being an AVOption, the best solution is to remove it from the options table. --- libavcodec/options_table.h | 1 - 1 file changed, 1 deletion(-) diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h index eed3bdb483..5ecf4f7ee9 100644 --- a/libavcodec/options_table.h +++ b/libavcodec/options_table.h @@ -159,7 +159,6 @@ static const AVOption options[]={ {"block_align", NULL, OFFSET(block_align), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"mpeg_quant", "use MPEG quantizers instead of H.263", OFFSET(mpeg_quant), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"stats_out", NULL, OFFSET(stats_out), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX}, -{"stats_in", NULL, OFFSET(stats_in), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX}, {"qsquish", "how to keep quantizer between qmin and qmax (0 = clip, 1 = use differentiable function)", OFFSET(rc_qsquish), AV_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, 0, 99, V|E}, {"rc_qmod_amp", "experimental quantizer modulation", OFFSET(rc_qmod_amp), AV_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, -FLT_MAX, FLT_MAX, V|E}, {"rc_qmod_freq", "experimental quantizer modulation", OFFSET(rc_qmod_freq), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, -- cgit v1.2.3 From 394a2a04527d480b605a4c7331222df03f964fcd Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 16 May 2012 08:15:54 +0200 Subject: lavfi: rename vf_fifo.c -> fifo.c It will be used for audio too. --- libavfilter/Makefile | 2 +- libavfilter/fifo.c | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++ libavfilter/vf_fifo.c | 121 -------------------------------------------------- 3 files changed, 122 insertions(+), 122 deletions(-) create mode 100644 libavfilter/fifo.c delete mode 100644 libavfilter/vf_fifo.c diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 955a97cafb..a4cc7f3737 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -47,7 +47,7 @@ OBJS-$(CONFIG_DRAWBOX_FILTER) += vf_drawbox.o OBJS-$(CONFIG_DRAWTEXT_FILTER) += vf_drawtext.o OBJS-$(CONFIG_FADE_FILTER) += vf_fade.o OBJS-$(CONFIG_FIELDORDER_FILTER) += vf_fieldorder.o -OBJS-$(CONFIG_FIFO_FILTER) += vf_fifo.o +OBJS-$(CONFIG_FIFO_FILTER) += fifo.o OBJS-$(CONFIG_FORMAT_FILTER) += vf_format.o OBJS-$(CONFIG_FPS_FILTER) += vf_fps.o OBJS-$(CONFIG_FREI0R_FILTER) += vf_frei0r.o diff --git a/libavfilter/fifo.c b/libavfilter/fifo.c new file mode 100644 index 0000000000..1785946a4f --- /dev/null +++ b/libavfilter/fifo.c @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2007 Bobby Bingham + * + * This file is part of Libav. + * + * Libav is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * Libav is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Libav; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * FIFO buffering video filter + */ + +#include "avfilter.h" +#include "internal.h" +#include "video.h" + +typedef struct BufPic { + AVFilterBufferRef *picref; + struct BufPic *next; +} BufPic; + +typedef struct { + BufPic root; + BufPic *last; ///< last buffered picture +} FifoContext; + +static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) +{ + FifoContext *fifo = ctx->priv; + fifo->last = &fifo->root; + + av_log(ctx, AV_LOG_INFO, "\n"); + return 0; +} + +static av_cold void uninit(AVFilterContext *ctx) +{ + FifoContext *fifo = ctx->priv; + BufPic *pic, *tmp; + + for (pic = fifo->root.next; pic; pic = tmp) { + tmp = pic->next; + avfilter_unref_buffer(pic->picref); + av_free(pic); + } +} + +static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) +{ + FifoContext *fifo = inlink->dst->priv; + + fifo->last->next = av_mallocz(sizeof(BufPic)); + fifo->last = fifo->last->next; + fifo->last->picref = picref; +} + +static void end_frame(AVFilterLink *inlink) { } + +static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) { } + +static int request_frame(AVFilterLink *outlink) +{ + FifoContext *fifo = outlink->src->priv; + BufPic *tmp; + int ret; + + if (!fifo->root.next) { + if ((ret = ff_request_frame(outlink->src->inputs[0]) < 0)) + return ret; + } + + /* by doing this, we give ownership of the reference to the next filter, + * so we don't have to worry about dereferencing it ourselves. */ + ff_start_frame(outlink, fifo->root.next->picref); + ff_draw_slice (outlink, 0, outlink->h, 1); + ff_end_frame (outlink); + + if (fifo->last == fifo->root.next) + fifo->last = &fifo->root; + tmp = fifo->root.next->next; + av_free(fifo->root.next); + fifo->root.next = tmp; + + return 0; +} + +AVFilter avfilter_vf_fifo = { + .name = "fifo", + .description = NULL_IF_CONFIG_SMALL("Buffer input images and send them when they are requested."), + + .init = init, + .uninit = uninit, + + .priv_size = sizeof(FifoContext), + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .get_video_buffer= ff_null_get_video_buffer, + .start_frame = start_frame, + .draw_slice = draw_slice, + .end_frame = end_frame, + .rej_perms = AV_PERM_REUSE2, }, + { .name = NULL}}, + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .request_frame = request_frame, }, + { .name = NULL}}, +}; diff --git a/libavfilter/vf_fifo.c b/libavfilter/vf_fifo.c deleted file mode 100644 index 1785946a4f..0000000000 --- a/libavfilter/vf_fifo.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2007 Bobby Bingham - * - * This file is part of Libav. - * - * Libav is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * Libav is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/** - * @file - * FIFO buffering video filter - */ - -#include "avfilter.h" -#include "internal.h" -#include "video.h" - -typedef struct BufPic { - AVFilterBufferRef *picref; - struct BufPic *next; -} BufPic; - -typedef struct { - BufPic root; - BufPic *last; ///< last buffered picture -} FifoContext; - -static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) -{ - FifoContext *fifo = ctx->priv; - fifo->last = &fifo->root; - - av_log(ctx, AV_LOG_INFO, "\n"); - return 0; -} - -static av_cold void uninit(AVFilterContext *ctx) -{ - FifoContext *fifo = ctx->priv; - BufPic *pic, *tmp; - - for (pic = fifo->root.next; pic; pic = tmp) { - tmp = pic->next; - avfilter_unref_buffer(pic->picref); - av_free(pic); - } -} - -static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) -{ - FifoContext *fifo = inlink->dst->priv; - - fifo->last->next = av_mallocz(sizeof(BufPic)); - fifo->last = fifo->last->next; - fifo->last->picref = picref; -} - -static void end_frame(AVFilterLink *inlink) { } - -static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) { } - -static int request_frame(AVFilterLink *outlink) -{ - FifoContext *fifo = outlink->src->priv; - BufPic *tmp; - int ret; - - if (!fifo->root.next) { - if ((ret = ff_request_frame(outlink->src->inputs[0]) < 0)) - return ret; - } - - /* by doing this, we give ownership of the reference to the next filter, - * so we don't have to worry about dereferencing it ourselves. */ - ff_start_frame(outlink, fifo->root.next->picref); - ff_draw_slice (outlink, 0, outlink->h, 1); - ff_end_frame (outlink); - - if (fifo->last == fifo->root.next) - fifo->last = &fifo->root; - tmp = fifo->root.next->next; - av_free(fifo->root.next); - fifo->root.next = tmp; - - return 0; -} - -AVFilter avfilter_vf_fifo = { - .name = "fifo", - .description = NULL_IF_CONFIG_SMALL("Buffer input images and send them when they are requested."), - - .init = init, - .uninit = uninit, - - .priv_size = sizeof(FifoContext), - - .inputs = (AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .get_video_buffer= ff_null_get_video_buffer, - .start_frame = start_frame, - .draw_slice = draw_slice, - .end_frame = end_frame, - .rej_perms = AV_PERM_REUSE2, }, - { .name = NULL}}, - .outputs = (AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .request_frame = request_frame, }, - { .name = NULL}}, -}; -- cgit v1.2.3 From 27570e211a080a9a0498bac16364447508e3ba7c Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 27 May 2012 22:45:52 +0200 Subject: fifo: fix parenthesis placement. --- libavfilter/fifo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/fifo.c b/libavfilter/fifo.c index 1785946a4f..6d21d5db2f 100644 --- a/libavfilter/fifo.c +++ b/libavfilter/fifo.c @@ -78,7 +78,7 @@ static int request_frame(AVFilterLink *outlink) int ret; if (!fifo->root.next) { - if ((ret = ff_request_frame(outlink->src->inputs[0]) < 0)) + if ((ret = ff_request_frame(outlink->src->inputs[0])) < 0) return ret; } -- cgit v1.2.3 From 4a97ff2fa7a733e657c464640f6f787293849aee Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 16 May 2012 08:21:47 +0200 Subject: lavfi/fifo: add audio version of the fifo filter. --- libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/fifo.c | 71 ++++++++++++++++++++++++++++++++++-------------- 3 files changed, 53 insertions(+), 20 deletions(-) diff --git a/libavfilter/Makefile b/libavfilter/Makefile index a4cc7f3737..377956e6af 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -25,6 +25,7 @@ OBJS = allfilters.o \ vf_scale.o \ video.o \ +OBJS-$(CONFIG_AFIFO_FILTER) += fifo.o OBJS-$(CONFIG_AFORMAT_FILTER) += af_aformat.o OBJS-$(CONFIG_AMIX_FILTER) += af_amix.o OBJS-$(CONFIG_ANULL_FILTER) += af_anull.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index 118f09d057..5a249c08c8 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -34,6 +34,7 @@ void avfilter_register_all(void) return; initialized = 1; + REGISTER_FILTER (AFIFO, afifo, af); REGISTER_FILTER (AFORMAT, aformat, af); REGISTER_FILTER (AMIX, amix, af); REGISTER_FILTER (ANULL, anull, af); diff --git a/libavfilter/fifo.c b/libavfilter/fifo.c index 6d21d5db2f..3fa4faab39 100644 --- a/libavfilter/fifo.c +++ b/libavfilter/fifo.c @@ -20,21 +20,22 @@ /** * @file - * FIFO buffering video filter + * FIFO buffering filter */ +#include "audio.h" #include "avfilter.h" #include "internal.h" #include "video.h" -typedef struct BufPic { - AVFilterBufferRef *picref; - struct BufPic *next; -} BufPic; +typedef struct Buf { + AVFilterBufferRef *buf; + struct Buf *next; +} Buf; typedef struct { - BufPic root; - BufPic *last; ///< last buffered picture + Buf root; + Buf *last; ///< last buffered frame } FifoContext; static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) @@ -49,22 +50,22 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) static av_cold void uninit(AVFilterContext *ctx) { FifoContext *fifo = ctx->priv; - BufPic *pic, *tmp; + Buf *buf, *tmp; - for (pic = fifo->root.next; pic; pic = tmp) { - tmp = pic->next; - avfilter_unref_buffer(pic->picref); - av_free(pic); + for (buf = fifo->root.next; buf; buf = tmp) { + tmp = buf->next; + avfilter_unref_buffer(buf->buf); + av_free(buf); } } -static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) +static void add_to_queue(AVFilterLink *inlink, AVFilterBufferRef *buf) { FifoContext *fifo = inlink->dst->priv; - fifo->last->next = av_mallocz(sizeof(BufPic)); + fifo->last->next = av_mallocz(sizeof(Buf)); fifo->last = fifo->last->next; - fifo->last->picref = picref; + fifo->last->buf = buf; } static void end_frame(AVFilterLink *inlink) { } @@ -74,7 +75,7 @@ static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) { } static int request_frame(AVFilterLink *outlink) { FifoContext *fifo = outlink->src->priv; - BufPic *tmp; + Buf *tmp; int ret; if (!fifo->root.next) { @@ -84,9 +85,18 @@ static int request_frame(AVFilterLink *outlink) /* by doing this, we give ownership of the reference to the next filter, * so we don't have to worry about dereferencing it ourselves. */ - ff_start_frame(outlink, fifo->root.next->picref); - ff_draw_slice (outlink, 0, outlink->h, 1); - ff_end_frame (outlink); + switch (outlink->type) { + case AVMEDIA_TYPE_VIDEO: + ff_start_frame(outlink, fifo->root.next->buf); + ff_draw_slice (outlink, 0, outlink->h, 1); + ff_end_frame (outlink); + break; + case AVMEDIA_TYPE_AUDIO: + ff_filter_samples(outlink, fifo->root.next->buf); + break; + default: + return AVERROR(EINVAL); + } if (fifo->last == fifo->root.next) fifo->last = &fifo->root; @@ -109,7 +119,7 @@ AVFilter avfilter_vf_fifo = { .inputs = (AVFilterPad[]) {{ .name = "default", .type = AVMEDIA_TYPE_VIDEO, .get_video_buffer= ff_null_get_video_buffer, - .start_frame = start_frame, + .start_frame = add_to_queue, .draw_slice = draw_slice, .end_frame = end_frame, .rej_perms = AV_PERM_REUSE2, }, @@ -119,3 +129,24 @@ AVFilter avfilter_vf_fifo = { .request_frame = request_frame, }, { .name = NULL}}, }; + +AVFilter avfilter_af_afifo = { + .name = "afifo", + .description = NULL_IF_CONFIG_SMALL("Buffer input frames and send them when they are requested."), + + .init = init, + .uninit = uninit, + + .priv_size = sizeof(FifoContext), + + .inputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_AUDIO, + .get_audio_buffer = ff_null_get_audio_buffer, + .filter_samples = add_to_queue, + .rej_perms = AV_PERM_REUSE2, }, + { .name = NULL}}, + .outputs = (AVFilterPad[]) {{ .name = "default", + .type = AVMEDIA_TYPE_AUDIO, + .request_frame = request_frame, }, + { .name = NULL}}, +}; -- cgit v1.2.3 From e026c9b390102fc8b77e6d49ba7a6db7b7c80324 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 17 Jun 2012 10:21:49 +0200 Subject: lavfi/audio: don't set cur_buf in ff_filter_samples(). It's redundant, since the input buffer is passed as a parameter to the filter_samples() callback, and can lead to stale pointers remaining on the link. --- libavfilter/audio.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/libavfilter/audio.c b/libavfilter/audio.c index a6fef9d273..72e2ced478 100644 --- a/libavfilter/audio.c +++ b/libavfilter/audio.c @@ -176,6 +176,7 @@ void ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref) { void (*filter_samples)(AVFilterLink *, AVFilterBufferRef *); AVFilterPad *dst = link->dstpad; + AVFilterBufferRef *buf_out; FF_DPRINTF_START(NULL, filter_samples); ff_dlog_link(NULL, link, 1); @@ -189,21 +190,21 @@ void ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref) "Copying audio data in avfilter (have perms %x, need %x, reject %x)\n", samplesref->perms, link->dstpad->min_perms, link->dstpad->rej_perms); - link->cur_buf = ff_default_get_audio_buffer(link, dst->min_perms, - samplesref->audio->nb_samples); - link->cur_buf->pts = samplesref->pts; - link->cur_buf->audio->sample_rate = samplesref->audio->sample_rate; + buf_out = ff_default_get_audio_buffer(link, dst->min_perms, + samplesref->audio->nb_samples); + buf_out->pts = samplesref->pts; + buf_out->audio->sample_rate = samplesref->audio->sample_rate; /* Copy actual data into new samples buffer */ - av_samples_copy(link->cur_buf->extended_data, samplesref->extended_data, + av_samples_copy(buf_out->extended_data, samplesref->extended_data, 0, 0, samplesref->audio->nb_samples, av_get_channel_layout_nb_channels(link->channel_layout), link->format); avfilter_unref_buffer(samplesref); } else - link->cur_buf = samplesref; + buf_out = samplesref; - filter_samples(link, link->cur_buf); + filter_samples(link, buf_out); } -- cgit v1.2.3 From dc7e336caee002e8765e4656331d3a5c1a1ba5ff Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Wed, 20 Jun 2012 17:28:34 +0100 Subject: lavf, lavu: version bumps and APIchanges for av_gettime() move Signed-off-by: Mans Rullgard --- doc/APIchanges | 3 +++ libavformat/version.h | 4 ++-- libavutil/avutil.h | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 4d14882f48..85db9033cb 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -13,6 +13,9 @@ libavutil: 2011-04-18 API changes, most recent first: +2012-06-20 - ae0a301 - lavu 51.33.0 + Move av_gettime() to libavutil, add libavutil/time.h + 2012-xx-xx - xxxxxxx - lavr 0.0.3 Add a parameter to avresample_build_matrix() for Dolby/DPLII downmixing. diff --git a/libavformat/version.h b/libavformat/version.h index 29e520534c..e2fa56188b 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -30,8 +30,8 @@ #include "libavutil/avutil.h" #define LIBAVFORMAT_VERSION_MAJOR 54 -#define LIBAVFORMAT_VERSION_MINOR 5 -#define LIBAVFORMAT_VERSION_MICRO 2 +#define LIBAVFORMAT_VERSION_MINOR 6 +#define LIBAVFORMAT_VERSION_MICRO 0 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ LIBAVFORMAT_VERSION_MINOR, \ diff --git a/libavutil/avutil.h b/libavutil/avutil.h index 25c159dc5d..ce73754ead 100644 --- a/libavutil/avutil.h +++ b/libavutil/avutil.h @@ -152,7 +152,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 51 -#define LIBAVUTIL_VERSION_MINOR 32 +#define LIBAVUTIL_VERSION_MINOR 33 #define LIBAVUTIL_VERSION_MICRO 0 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ -- cgit v1.2.3 From 89ffd189efb3ff53bfaa3e7b3ad4e18d6c9ba03d Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Wed, 20 Jun 2012 10:11:43 -0700 Subject: twinvq: give massive struct a name. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- libavcodec/twinvq_data.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/twinvq_data.h b/libavcodec/twinvq_data.h index 1f1f33408e..a23612708c 100644 --- a/libavcodec/twinvq_data.h +++ b/libavcodec/twinvq_data.h @@ -135,7 +135,7 @@ static const uint16_t bark_tab_s44_128[] = { * * without risking a segfault on malformed files. */ -static const struct { +static const struct twinvq_data { float lsp08[504]; int16_t fcb08l[640]; int16_t fcb08m[320]; -- cgit v1.2.3 From 67ffcb9613b7bd35fd37a67a0d2363bd4d564605 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Wed, 20 Jun 2012 10:25:00 -0700 Subject: lavf: Make codec_tag arrays constant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- libavformat/cafdec.c | 2 +- libavformat/ivfdec.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c index e35026feda..d5ee9be92a 100644 --- a/libavformat/cafdec.c +++ b/libavformat/cafdec.c @@ -394,5 +394,5 @@ AVInputFormat ff_caf_demuxer = { .read_header = read_header, .read_packet = read_packet, .read_seek = read_seek, - .codec_tag = (const AVCodecTag*[]){ ff_codec_caf_tags, 0 }, + .codec_tag = (const AVCodecTag* const []){ ff_codec_caf_tags, 0 }, }; diff --git a/libavformat/ivfdec.c b/libavformat/ivfdec.c index 9482fc2ab0..b3555f42a4 100644 --- a/libavformat/ivfdec.c +++ b/libavformat/ivfdec.c @@ -87,5 +87,5 @@ AVInputFormat ff_ivf_demuxer = { .read_header = read_header, .read_packet = read_packet, .flags = AVFMT_GENERIC_INDEX, - .codec_tag = (const AVCodecTag*[]){ ff_codec_bmp_tags, 0 }, + .codec_tag = (const AVCodecTag* const []){ ff_codec_bmp_tags, 0 }, }; -- cgit v1.2.3 From 1d01fee980edf60215acd94daf2533a9fefb9342 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Thu, 21 Jun 2012 17:59:56 +0200 Subject: fix hardcoded tables compililation caused by missing math constants Add -D_XOPEN_SOURCE=600 to host cflags to make the constants in math.h available. Include math.h where necessary and remove redundant M_PI defines. --- configure | 2 +- libavcodec/aacps_tablegen.h | 1 + libavcodec/cos_tablegen.c | 3 --- libavcodec/sinewin_tablegen.c | 3 --- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/configure b/configure index 07608c4df3..14642faee9 100755 --- a/configure +++ b/configure @@ -1682,7 +1682,7 @@ SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)' AS_O='-o $@' CC_O='-o $@' -host_cflags='-D_ISOC99_SOURCE -O3 -g' +host_cflags='-D_ISOC99_SOURCE -D_XOPEN_SOURCE=600 -O3 -g' host_libs='-lm' target_path='$(CURDIR)' diff --git a/libavcodec/aacps_tablegen.h b/libavcodec/aacps_tablegen.h index d71a373858..bd4e695568 100644 --- a/libavcodec/aacps_tablegen.h +++ b/libavcodec/aacps_tablegen.h @@ -23,6 +23,7 @@ #ifndef AACPS_TABLEGEN_H #define AACPS_TABLEGEN_H +#include #include #if CONFIG_HARDCODED_TABLES diff --git a/libavcodec/cos_tablegen.c b/libavcodec/cos_tablegen.c index 5e52c482c6..8a9085704e 100644 --- a/libavcodec/cos_tablegen.c +++ b/libavcodec/cos_tablegen.c @@ -24,9 +24,6 @@ #include #include -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif #define BITS 16 #define FLOATFMT "%.18e" #define FIXEDFMT "%6d" diff --git a/libavcodec/sinewin_tablegen.c b/libavcodec/sinewin_tablegen.c index d5e06895ca..90a75c2267 100644 --- a/libavcodec/sinewin_tablegen.c +++ b/libavcodec/sinewin_tablegen.c @@ -26,9 +26,6 @@ #define SINETABLE(size) \ float ff_sine_##size[size] #define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0])) -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif #include "sinewin_tablegen.h" #include "tableprint.h" -- cgit v1.2.3