[FFmpeg-devel] [PATCH] Cosmetics: avoid some forward declarations in lavf/utils.c
Stefano Sabatini
stefano.sabatini-lala
Sat Aug 9 19:37:36 CEST 2008
On date Saturday 2008-08-09 19:29:33 +0200, Stefano Sabatini encoded:
> Hi all,
>
> as in subject, it also save a couple of warnings.
>
> Regards.
> --
> FFmpeg = Foolish and Friendly Minimalistic Prodigious Extravagant Ghost
> Index: libavformat/utils.c
> ===================================================================
> --- libavformat/utils.c (revision 14675)
> +++ libavformat/utils.c (working copy)
> @@ -38,9 +38,56 @@
> return LIBAVFORMAT_VERSION_INT;
> }
>
> -static void av_frac_init(AVFrac *f, int64_t val, int64_t num, int64_t den);
> -static void av_frac_add(AVFrac *f, int64_t incr);
> +/* fraction handling */
>
> +/**
> + * f = val + (num / den) + 0.5.
> + *
> + * 'num' is normalized so that it is such as 0 <= num < den.
> + *
> + * @param f fractional number
> + * @param val integer value
> + * @param num must be >= 0
> + * @param den must be >= 1
> + */
> +static void av_frac_init(AVFrac *f, int64_t val, int64_t num, int64_t den)
> +{
> + num += (den >> 1);
> + if (num >= den) {
> + val += num / den;
> + num = num % den;
> + }
> + f->val = val;
> + f->num = num;
> + f->den = den;
> +}
> +
> +/**
> + * Fractional addition to f: f = f + (incr / f->den).
> + *
> + * @param f fractional number
> + * @param incr increment, can be positive or negative
> + */
> +static void av_frac_add(AVFrac *f, int64_t incr)
> +{
> + int64_t num, den;
> +
> + num = f->num + incr;
> + den = f->den;
> + if (num < 0) {
> + f->val += num / den;
> + num = num % den;
> + if (num < 0) {
> + num += den;
> + f->val--;
> + }
> + } else if (num >= den) {
> + f->val += num / den;
> + num = num % den;
> + }
> + f->num = num;
> +}
> +
> /** head of registered input format linked list */
> AVInputFormat *first_iformat = NULL;
> /** head of registered output format linked list */
> @@ -3171,53 +3218,3 @@
> if(gcd>1)
> av_log(NULL, AV_LOG_DEBUG, "st:%d removing common factor %d from timebase\n", s->index, gcd);
> }
> -
> -/* fraction handling */
> -
> -/**
> - * f = val + (num / den) + 0.5.
> - *
> - * 'num' is normalized so that it is such as 0 <= num < den.
> - *
> - * @param f fractional number
> - * @param val integer value
> - * @param num must be >= 0
> - * @param den must be >= 1
> - */
> -static void av_frac_init(AVFrac *f, int64_t val, int64_t num, int64_t den)
> -{
> - num += (den >> 1);
> - if (num >= den) {
> - val += num / den;
> - num = num % den;
> - }
> - f->val = val;
> - f->num = num;
> - f->den = den;
> -}
> -
> -/**
> - * Fractional addition to f: f = f + (incr / f->den).
> - *
> - * @param f fractional number
> - * @param incr increment, can be positive or negative
> - */
> -static void av_frac_add(AVFrac *f, int64_t incr)
> -{
> - int64_t num, den;
> -
> - num = f->num + incr;
> - den = f->den;
> - if (num < 0) {
> - f->val += num / den;
> - num = num % den;
> - if (num < 0) {
> - num += den;
> - f->val--;
> - }
> - } else if (num >= den) {
> - f->val += num / den;
> - num = num % den;
> - }
> - f->num = num;
> -}
And since they're not used anymore and AVFrac is deprecated, what
about to remove them?
Regards.
--
FFmpeg = Freak and Faboulous Mean Programmable ExchanGer
More information about the ffmpeg-devel
mailing list