Browse Source

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  avconv: add an assert to silence an uninitialized variable warning.
  avconv: shut up an uninitialized variable warning.
  avfiltergraph: shut up uninitialized variable warning.
  af_join: initialize a variable to shut up gcc warning.
  amix: fix format specifier for AVFilterLink.sample_rate.
  lavfi: make filters less verbose.
  mpc8: read APE tags.
  lavr: x86: fix ff_conv_fltp_to_flt_6ch function prototypes
  libm: provide fallback definition for cbrtf() using powf()
  network: Don't redefine error codes if they already exist in errno.h
  configure: Check for sys/time.h
  network: Include unistd.h from network.h
  avconv: don't include vsrc_buffer.h, which doesn't exist anymore
  lavfi: reorder AVFilterLink fields.
  lavfi: reorder AVFilterContext fields.
  lavfi: reorder AVFilter fields.
  lavfi: reorder AVFilterBufferRef fields.
  lavfi: reorder AVFilterBuffer fields.

Conflicts:
	configure
	libavcodec/v210dec.h
	libavfilter/asrc_anullsrc.c
	libavfilter/avfilter.h
	libavfilter/buffersrc.c
	libavfilter/src_movie.c
	libavfilter/vf_aspect.c
	libavfilter/vf_crop.c
	libavfilter/vf_drawbox.c
	libavfilter/vf_fade.c
	libavfilter/vf_overlay.c
	libavfilter/vf_pad.c
	libavfilter/vf_scale.c
	libavfilter/vsrc_color.c
	libavformat/network.h
	libavutil/libm.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Michael Niedermayer 12 years ago
parent
commit
b536e2facf

+ 2 - 0
configure

@@ -1275,6 +1275,7 @@ HAVE_LIST="
     sys_resource_h
     sys_resource_h
     sys_select_h
     sys_select_h
     sys_soundcard_h
     sys_soundcard_h
+    sys_time_h
     sys_videoio_h
     sys_videoio_h
     termios_h
     termios_h
     threads
     threads
@@ -3187,6 +3188,7 @@ check_header sys/mman.h
 check_header sys/param.h
 check_header sys/param.h
 check_header sys/resource.h
 check_header sys/resource.h
 check_header sys/select.h
 check_header sys/select.h
+check_header sys/time.h
 check_header termios.h
 check_header termios.h
 check_header unistd.h
 check_header unistd.h
 check_header vdpau/vdpau.h
 check_header vdpau/vdpau.h

+ 3 - 0
ffmpeg.c

@@ -760,6 +760,8 @@ static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
             exit_program(1);
             exit_program(1);
         }
         }
     }
     }
+    av_assert0(ist);
+
     ist->discard         = 0;
     ist->discard         = 0;
     ist->decoding_needed = 1;
     ist->decoding_needed = 1;
     ist->st->discard = AVDISCARD_NONE;
     ist->st->discard = AVDISCARD_NONE;
@@ -4023,6 +4025,7 @@ static int copy_metadata(char *outspec, char *inspec, AVFormatContext *oc, AVFor
             METADATA_CHECK_INDEX(index, context->nb_programs, "program")\
             METADATA_CHECK_INDEX(index, context->nb_programs, "program")\
             meta = &context->programs[index]->metadata;\
             meta = &context->programs[index]->metadata;\
             break;\
             break;\
+        default: av_assert0(0);\
         }\
         }\
 
 
     SET_DICT(type_in, meta_in, ic, idx_in);
     SET_DICT(type_in, meta_in, ic, idx_in);

+ 1 - 1
libavfilter/af_amix.c

@@ -255,7 +255,7 @@ static int config_output(AVFilterLink *outlink)
     av_get_channel_layout_string(buf, sizeof(buf), -1, outlink->channel_layout);
     av_get_channel_layout_string(buf, sizeof(buf), -1, outlink->channel_layout);
 
 
     av_log(ctx, AV_LOG_VERBOSE,
     av_log(ctx, AV_LOG_VERBOSE,
-           "inputs:%d fmt:%s srate:%"PRId64" cl:%s\n", s->nb_inputs,
+           "inputs:%d fmt:%s srate:%d cl:%s\n", s->nb_inputs,
            av_get_sample_fmt_name(outlink->format), outlink->sample_rate, buf);
            av_get_sample_fmt_name(outlink->format), outlink->sample_rate, buf);
 
 
     return 0;
     return 0;

+ 2 - 1
libavfilter/af_join.c

@@ -419,7 +419,7 @@ static int join_request_frame(AVFilterLink *outlink)
     JoinBufferPriv *priv;
     JoinBufferPriv *priv;
     int linesize   = INT_MAX;
     int linesize   = INT_MAX;
     int perms      = ~0;
     int perms      = ~0;
-    int nb_samples;
+    int nb_samples = 0;
     int i, j, ret;
     int i, j, ret;
 
 
     /* get a frame on each input */
     /* get a frame on each input */
@@ -448,6 +448,7 @@ static int join_request_frame(AVFilterLink *outlink)
         perms     &= cur_buf->perms;
         perms     &= cur_buf->perms;
     }
     }
 
 
+    av_assert0(nb_samples > 0);
     buf = avfilter_get_audio_buffer_ref_from_arrays(s->data, linesize, perms,
     buf = avfilter_get_audio_buffer_ref_from_arrays(s->data, linesize, perms,
                                                     nb_samples, outlink->format,
                                                     nb_samples, outlink->format,
                                                     outlink->channel_layout);
                                                     outlink->channel_layout);

+ 1 - 1
libavfilter/asrc_anullsrc.c

@@ -91,7 +91,7 @@ static int config_props(AVFilterLink *outlink)
 
 
     chans_nb = av_get_channel_layout_nb_channels(null->channel_layout);
     chans_nb = av_get_channel_layout_nb_channels(null->channel_layout);
     av_get_channel_layout_string(buf, sizeof(buf), chans_nb, null->channel_layout);
     av_get_channel_layout_string(buf, sizeof(buf), chans_nb, null->channel_layout);
-    av_log(outlink->src, AV_LOG_INFO,
+    av_log(outlink->src, AV_LOG_VERBOSE,
            "sample_rate:%d channel_layout:'%s' nb_samples:%d\n",
            "sample_rate:%d channel_layout:'%s' nb_samples:%d\n",
            null->sample_rate, buf, null->nb_samples);
            null->sample_rate, buf, null->nb_samples);
 
 

+ 1 - 1
libavfilter/avfilter.c

@@ -163,7 +163,7 @@ int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt,
     int ret;
     int ret;
     unsigned dstpad_idx = link->dstpad - link->dst->input_pads;
     unsigned dstpad_idx = link->dstpad - link->dst->input_pads;
 
 
-    av_log(link->dst, AV_LOG_INFO, "auto-inserting filter '%s' "
+    av_log(link->dst, AV_LOG_VERBOSE, "auto-inserting filter '%s' "
            "between the filter '%s' and the filter '%s'\n",
            "between the filter '%s' and the filter '%s'\n",
            filt->name, link->src->name, link->dst->name);
            filt->name, link->src->name, link->dst->name);
 
 

+ 85 - 78
libavfilter/avfilter.h

@@ -60,22 +60,6 @@ typedef struct AVFilterFormats AVFilterFormats;
  */
  */
 typedef struct AVFilterBuffer {
 typedef struct AVFilterBuffer {
     uint8_t *data[8];           ///< buffer data for each plane/channel
     uint8_t *data[8];           ///< buffer data for each plane/channel
-    int linesize[8];            ///< number of bytes per line
-
-    unsigned refcount;          ///< number of references to this buffer
-
-    /** private data to be used by a custom free function */
-    void *priv;
-    /**
-     * A pointer to the function to deallocate this buffer if the default
-     * function is not sufficient. This could, for example, add the memory
-     * back into a memory pool to be reused later without the overhead of
-     * reallocating it from scratch.
-     */
-    void (*free)(struct AVFilterBuffer *buf);
-
-    int format;                 ///< media format
-    int w, h;                   ///< width and height of the allocated buffer
 
 
     /**
     /**
      * pointers to the data planes/channels.
      * pointers to the data planes/channels.
@@ -92,6 +76,21 @@ typedef struct AVFilterBuffer {
      * in order to access all channels.
      * in order to access all channels.
      */
      */
     uint8_t **extended_data;
     uint8_t **extended_data;
+    int linesize[8];            ///< number of bytes per line
+
+    /** private data to be used by a custom free function */
+    void *priv;
+    /**
+     * A pointer to the function to deallocate this buffer if the default
+     * function is not sufficient. This could, for example, add the memory
+     * back into a memory pool to be reused later without the overhead of
+     * reallocating it from scratch.
+     */
+    void (*free)(struct AVFilterBuffer *buf);
+
+    int format;                 ///< media format
+    int w, h;                   ///< width and height of the allocated buffer
+    unsigned refcount;          ///< number of references to this buffer
 } AVFilterBuffer;
 } AVFilterBuffer;
 
 
 #define AV_PERM_READ     0x01   ///< can read from the buffer
 #define AV_PERM_READ     0x01   ///< can read from the buffer
@@ -141,23 +140,6 @@ typedef struct AVFilterBufferRefVideoProps {
 typedef struct AVFilterBufferRef {
 typedef struct AVFilterBufferRef {
     AVFilterBuffer *buf;        ///< the buffer that this is a reference to
     AVFilterBuffer *buf;        ///< the buffer that this is a reference to
     uint8_t *data[8];           ///< picture/audio data for each plane
     uint8_t *data[8];           ///< picture/audio data for each plane
-    int linesize[8];            ///< number of bytes per line
-    int format;                 ///< media format
-
-    /**
-     * presentation timestamp. The time unit may change during
-     * filtering, as it is specified in the link and the filter code
-     * may need to rescale the PTS accordingly.
-     */
-    int64_t pts;
-    int64_t pos;                ///< byte position in stream, -1 if unknown
-
-    int perms;                  ///< permissions, see the AV_PERM_* flags
-
-    enum AVMediaType type;      ///< media type of buffer data
-    AVFilterBufferRefVideoProps *video; ///< video buffer specific properties
-    AVFilterBufferRefAudioProps *audio; ///< audio buffer specific properties
-
     /**
     /**
      * pointers to the data planes/channels.
      * pointers to the data planes/channels.
      *
      *
@@ -173,6 +155,24 @@ typedef struct AVFilterBufferRef {
      * in order to access all channels.
      * in order to access all channels.
      */
      */
     uint8_t **extended_data;
     uint8_t **extended_data;
+    int linesize[8];            ///< number of bytes per line
+
+    AVFilterBufferRefVideoProps *video; ///< video buffer specific properties
+    AVFilterBufferRefAudioProps *audio; ///< audio buffer specific properties
+
+    /**
+     * presentation timestamp. The time unit may change during
+     * filtering, as it is specified in the link and the filter code
+     * may need to rescale the PTS accordingly.
+     */
+    int64_t pts;
+    int64_t pos;                ///< byte position in stream, -1 if unknown
+
+    int format;                 ///< media format
+
+    int perms;                  ///< permissions, see the AV_PERM_* flags
+
+    enum AVMediaType type;      ///< media type of buffer data
 } AVFilterBufferRef;
 } AVFilterBufferRef;
 
 
 /**
 /**
@@ -388,7 +388,22 @@ void avfilter_default_end_frame(AVFilterLink *link);
 typedef struct AVFilter {
 typedef struct AVFilter {
     const char *name;         ///< filter name
     const char *name;         ///< filter name
 
 
-    int priv_size;      ///< size of private data to allocate for the filter
+    /**
+     * A description for the filter. You should use the
+     * NULL_IF_CONFIG_SMALL() macro to define it.
+     */
+    const char *description;
+
+    const AVFilterPad *inputs;  ///< NULL terminated list of inputs. NULL if none
+    const AVFilterPad *outputs; ///< NULL terminated list of outputs. NULL if none
+
+    /*****************************************************************
+     * All fields below this line are not part of the public API. They
+     * may not be used outside of libavfilter and can be changed and
+     * removed at will.
+     * New public fields should be added right above.
+     *****************************************************************
+     */
 
 
     /**
     /**
      * Filter initialization function. Args contains the user-supplied
      * Filter initialization function. Args contains the user-supplied
@@ -413,14 +428,7 @@ typedef struct AVFilter {
      */
      */
     int (*query_formats)(AVFilterContext *);
     int (*query_formats)(AVFilterContext *);
 
 
-    const AVFilterPad *inputs;  ///< NULL terminated list of inputs. NULL if none
-    const AVFilterPad *outputs; ///< NULL terminated list of outputs. NULL if none
-
-    /**
-     * A description for the filter. You should use the
-     * NULL_IF_CONFIG_SMALL() macro to define it.
-     */
-    const char *description;
+    int priv_size;      ///< size of private data to allocate for the filter
 
 
     /**
     /**
      * Make the filter instance process a command.
      * Make the filter instance process a command.
@@ -445,23 +453,22 @@ struct AVFilterContext {
 
 
     char *name;                     ///< name of this filter instance
     char *name;                     ///< name of this filter instance
 
 
+    AVFilterPad   *input_pads;      ///< array of input pads
+    AVFilterLink **inputs;          ///< array of pointers to input links
 #if FF_API_FOO_COUNT
 #if FF_API_FOO_COUNT
     unsigned input_count;           ///< @deprecated use nb_inputs
     unsigned input_count;           ///< @deprecated use nb_inputs
 #endif
 #endif
-    AVFilterPad   *input_pads;      ///< array of input pads
-    AVFilterLink **inputs;          ///< array of pointers to input links
+    unsigned    nb_inputs;          ///< number of input pads
 
 
+    AVFilterPad   *output_pads;     ///< array of output pads
+    AVFilterLink **outputs;         ///< array of pointers to output links
 #if FF_API_FOO_COUNT
 #if FF_API_FOO_COUNT
     unsigned output_count;          ///< @deprecated use nb_outputs
     unsigned output_count;          ///< @deprecated use nb_outputs
 #endif
 #endif
-    AVFilterPad   *output_pads;     ///< array of output pads
-    AVFilterLink **outputs;         ///< array of pointers to output links
+    unsigned    nb_outputs;         ///< number of output pads
 
 
     void *priv;                     ///< private data for use by the filter
     void *priv;                     ///< private data for use by the filter
 
 
-    unsigned nb_inputs;             ///< number of input pads
-    unsigned nb_outputs;            ///< number of output pads
-
     struct AVFilterCommand *command_queue;
     struct AVFilterCommand *command_queue;
 };
 };
 
 
@@ -479,13 +486,6 @@ struct AVFilterLink {
     AVFilterContext *dst;       ///< dest filter
     AVFilterContext *dst;       ///< dest filter
     AVFilterPad *dstpad;        ///< input pad on the dest filter
     AVFilterPad *dstpad;        ///< input pad on the dest filter
 
 
-    /** stage of the initialization of the link properties (dimensions, etc) */
-    enum {
-        AVLINK_UNINIT = 0,      ///< not started
-        AVLINK_STARTINIT,       ///< started, but incomplete
-        AVLINK_INIT             ///< complete
-    } init_state;
-
     enum AVMediaType type;      ///< filter media type
     enum AVMediaType type;      ///< filter media type
 
 
     /* These parameters apply only to video */
     /* These parameters apply only to video */
@@ -498,28 +498,6 @@ struct AVFilterLink {
 
 
     int format;                 ///< agreed upon media format
     int format;                 ///< agreed upon media format
 
 
-    /**
-     * Lists of formats and channel layouts supported by the input and output
-     * filters respectively. These lists are used for negotiating the format
-     * to actually be used, which will be loaded into the format and
-     * channel_layout members, above, when chosen.
-     *
-     */
-    AVFilterFormats *in_formats;
-    AVFilterFormats *out_formats;
-
-    /**
-     * The buffer reference currently being sent across the link by the source
-     * filter. This is used internally by the filter system to allow
-     * automatic copying of buffers which do not have sufficient permissions
-     * for the destination. This should not be accessed directly by the
-     * filters.
-     */
-    AVFilterBufferRef *src_buf;
-
-    AVFilterBufferRef *cur_buf;
-    AVFilterBufferRef *out_buf;
-
     /**
     /**
      * Define the time base used by the PTS of the frames/samples
      * Define the time base used by the PTS of the frames/samples
      * which will pass through this link.
      * which will pass through this link.
@@ -536,6 +514,16 @@ struct AVFilterLink {
      * New public fields should be added right above.
      * New public fields should be added right above.
      *****************************************************************
      *****************************************************************
      */
      */
+    /**
+     * Lists of formats and channel layouts supported by the input and output
+     * filters respectively. These lists are used for negotiating the format
+     * to actually be used, which will be loaded into the format and
+     * channel_layout members, above, when chosen.
+     *
+     */
+    AVFilterFormats *in_formats;
+    AVFilterFormats *out_formats;
+
     /**
     /**
      * Lists of channel layouts and sample rates used for automatic
      * Lists of channel layouts and sample rates used for automatic
      * negotiation.
      * negotiation.
@@ -554,6 +542,25 @@ struct AVFilterLink {
      */
      */
     int request_samples;
     int request_samples;
 
 
+    /** stage of the initialization of the link properties (dimensions, etc) */
+    enum {
+        AVLINK_UNINIT = 0,      ///< not started
+        AVLINK_STARTINIT,       ///< started, but incomplete
+        AVLINK_INIT             ///< complete
+    } init_state;
+
+    /**
+     * The buffer reference currently being sent across the link by the source
+     * filter. This is used internally by the filter system to allow
+     * automatic copying of buffers which do not have sufficient permissions
+     * for the destination. This should not be accessed directly by the
+     * filters.
+     */
+    AVFilterBufferRef *src_buf;
+
+    AVFilterBufferRef *cur_buf;
+    AVFilterBufferRef *out_buf;
+
     struct AVFilterPool *pool;
     struct AVFilterPool *pool;
 
 
     /**
     /**

+ 3 - 1
libavfilter/avfiltergraph.c

@@ -33,6 +33,7 @@
 #include "internal.h"
 #include "internal.h"
 
 
 #include "libavutil/audioconvert.h"
 #include "libavutil/audioconvert.h"
+#include "libavutil/avassert.h"
 #include "libavutil/log.h"
 #include "libavutil/log.h"
 
 
 static const AVClass filtergraph_class = {
 static const AVClass filtergraph_class = {
@@ -648,7 +649,7 @@ static void swap_sample_fmts_on_filter(AVFilterContext *filter)
 
 
     for (i = 0; i < filter->nb_outputs; i++) {
     for (i = 0; i < filter->nb_outputs; i++) {
         AVFilterLink *outlink = filter->outputs[i];
         AVFilterLink *outlink = filter->outputs[i];
-        int best_idx, best_score = INT_MIN;
+        int best_idx = -1, best_score = INT_MIN;
 
 
         if (outlink->type != AVMEDIA_TYPE_AUDIO ||
         if (outlink->type != AVMEDIA_TYPE_AUDIO ||
             outlink->in_formats->format_count < 2)
             outlink->in_formats->format_count < 2)
@@ -681,6 +682,7 @@ static void swap_sample_fmts_on_filter(AVFilterContext *filter)
                 best_idx   = j;
                 best_idx   = j;
             }
             }
         }
         }
+        av_assert0(best_idx >= 0);
         FFSWAP(int, outlink->in_formats->formats[0],
         FFSWAP(int, outlink->in_formats->formats[0],
                outlink->in_formats->formats[best_idx]);
                outlink->in_formats->formats[best_idx]);
     }
     }

+ 0 - 1
libavfilter/fifo.c

@@ -55,7 +55,6 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
     FifoContext *fifo = ctx->priv;
     FifoContext *fifo = ctx->priv;
     fifo->last = &fifo->root;
     fifo->last = &fifo->root;
 
 
-    av_log(ctx, AV_LOG_INFO, "\n");
     return 0;
     return 0;
 }
 }
 
 

+ 1 - 1
libavfilter/src_movie.c

@@ -167,7 +167,7 @@ static av_cold int movie_common_init(AVFilterContext *ctx, const char *args,
         return ret;
         return ret;
     }
     }
 
 
-    av_log(ctx, AV_LOG_INFO, "seek_point:%"PRIi64" format_name:%s file_name:%s stream_index:%d\n",
+    av_log(ctx, AV_LOG_VERBOSE, "seek_point:%"PRIi64" format_name:%s file_name:%s stream_index:%d\n",
            movie->seek_point, movie->format_name, movie->file_name,
            movie->seek_point, movie->format_name, movie->file_name,
            movie->stream_index);
            movie->stream_index);
 
 

Some files were not shown because too many files changed in this diff