[FFmpeg-devel] [PATCH] lavfi: consistently use int for sample_rate in AVFilterLink and AVFilterBufferRefAudioProps

Michael Niedermayer michaelni at gmx.at
Sun Aug 21 21:33:37 CEST 2011


On Sun, Aug 21, 2011 at 07:38:35PM +0200, Michael Niedermayer wrote:
> On Sun, Aug 21, 2011 at 07:23:49PM +0200, Stefano Sabatini wrote:
> > Also consistent with AVCodecContext.sample_rate. Simplify/avoid
> > pointless type checks and conversions.
> > ---
> >  libavfilter/asrc_abuffer.c |    2 +-
> >  libavfilter/avfilter.c     |    2 +-
> >  libavfilter/avfilter.h     |    4 ++--
> >  libavfilter/formats.c      |    4 ++--
> >  libavfilter/internal.h     |    2 +-
> >  5 files changed, 7 insertions(+), 7 deletions(-)
> > 
> > diff --git a/libavfilter/asrc_abuffer.c b/libavfilter/asrc_abuffer.c
> > index cfa5f67..c1a583a 100644
> > --- a/libavfilter/asrc_abuffer.c
> > +++ b/libavfilter/asrc_abuffer.c
> > @@ -125,7 +125,7 @@ static inline void log_input_change(void *ctx, AVFilterLink *link, AVFilterBuffe
> >                                   -1, ref->audio->channel_layout);
> >      av_log(ctx, AV_LOG_INFO,
> >             "Audio input format changed: "
> > -           "%s:%s:%"PRId64" -> %s:%s:%u, normalizing\n",
> > +           "%s:%s:%d -> %s:%s:%d, normalizing\n",
> >             av_get_sample_fmt_name(link->format),
> >             old_layout_str, link->sample_rate,
> >             av_get_sample_fmt_name(ref->format),
> > diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
> > index 23bb26c..45d6bac 100644
> > --- a/libavfilter/avfilter.c
> > +++ b/libavfilter/avfilter.c
> > @@ -364,7 +364,7 @@ static void ff_dlog_link(void *ctx, AVFilterLink *link, int end)
> >          av_get_channel_layout_string(buf, sizeof(buf), -1, link->channel_layout);
> >  
> >          av_dlog(ctx,
> > -                "link[%p r:%"PRId64" cl:%s fmt:%-16s %-16s->%-16s]%s",
> > +                "link[%p r:%d cl:%s fmt:%-16s %-16s->%-16s]%s",
> >                  link, link->sample_rate, buf,
> >                  av_get_sample_fmt_name(link->format),
> >                  link->src ? link->src->filter->name : "",
> > diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
> > index 03fc83a..4aae4db 100644
> > --- a/libavfilter/avfilter.h
> > +++ b/libavfilter/avfilter.h
> > @@ -102,7 +102,7 @@ typedef struct AVFilterBuffer {
> >  typedef struct AVFilterBufferRefAudioProps {
> >      int64_t channel_layout;     ///< channel layout of audio buffer
> >      int nb_samples;             ///< number of audio samples per channel
> > -    uint32_t sample_rate;       ///< audio buffer sample rate
> > +    int sample_rate;            ///< audio buffer sample rate
> >      int planar;                 ///< audio buffer - planar or packed
> >  } AVFilterBufferRefAudioProps;
> >
> 
> > @@ -607,7 +607,7 @@ struct AVFilterLink {
> >      AVRational sample_aspect_ratio; ///< agreed upon sample aspect ratio
> >      /* These parameters apply only to audio */
> >      int64_t channel_layout;     ///< channel layout of current buffer (see libavutil/audioconvert.h)
> > -    int64_t sample_rate;        ///< samples per second
> > +    int sample_rate;            ///< samples per second
> >      int planar;                 ///< agreed upon packing mode of audio buffers. true if planar.
> 
> this breaks ABI

Let me elaborate on this a bit
I know libavfilter isnt really stable ABI yet but ffmpeg
and ffplay use libavfilter and if one of their dependancies changes
ABI without soname/major ver bump then this leads to problems for
binaries of these tools


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110821/ed503049/attachment.asc>


More information about the ffmpeg-devel mailing list