~medibuntu-maintainers/mplayer/medibuntu.precise

« back to all changes in this revision

Viewing changes to ffmpeg/libavutil/eval.c

  • Committer: Gauvain Pocentek
  • Date: 2012-03-06 11:59:12 UTC
  • mfrom: (66.1.15 precise)
  • Revision ID: gauvain@pocentek.net-20120306115912-h9d6kt9j0l532oo5
* Merge from Ubuntu:
  - put back faac support
  - recommends apport-hooks-medibuntu
  - change Maintainer, Uploaders & Vcs-* fields.
* New upstream snapshot
* upload to unstable
* Build against external libmpeg2
* drop 51_FTBFS_arm.patch again
* no longer build depend on libcdparanoia-dev on the Hurd
* Fix FTBFS on the hurd.
  Thanks to Samuel Thibault <sthibault@debian.org> (Closes: #654974)
* Fix FTBFS on arm
* New upstream snapshot, Closes: #650339, #643621, #481807
* Imported Upstream version 1.0~rc4+svn34492
* Bump standards version
* Bump dependency on libav >= 4:0.8~, Closes: #653887
* Fix build-indep
* Build mplayer-gui again, Closes: #568514
* Drop debian/all-lang-config-mak.sh, no longer needed
* include .dfsg1 in version number
* remove get-orig-source target
* no longer prune compiler flags from the environment
* No longer advertise nor build 3fdx, mga and dxr3 backends,
  Closes: #496106, #442181, #533546
* beautify mplayer version identification string
* Brown paperbag upload.
* Next try to fix build failure on sparce after recent binutils change.
* Brown paperbag upload.
* Really fix build failure on sparc after recent binutils change.
* Properly set Replaces/Conflicts on mplayer2{,-dbg} to avoid
  file overwrite errors.
* Adjust versioning of mplayer listed in the mplayer-dbg's Depends field.
* Fix build failure on sparc after recent binutils change.
* Urgency medium bumped because of RC-level bugfix
  and speeding up x264 transition.
* Update to my @debian.org email.
* Upload to unstable
* Enable joystick support on Linux only, Closes: #638408
* Rebuild fixes toolchain issue on arm, Closes: #637077
* New upstream snapshot
* following the discussion started by Diego Biurrun <diego@biurrun.de>
  in debian-devel, I have prepared a new packaging of 'mplayer'
  (with code that comes from CVS)
* the upstream tar.bz cannot be distributed by Debian, since it contains
   CSS code; so I am repackaging it 
* I have tried my best to address all known issues:
  - the package contains the detailed Copyright made by Diego Biurrun 
  - the package does not contain CSS code, or  AFAIK other code on which 
     there is active patent enforcement
  - there is a script  debian/cvs-changelog.sh  that shows all changes
     done to files included in this source.
    This should comply with GPLv2 sec 2.a  (in spirit if not in letter)
    For this reason, the source code contains CVS directories.
* needs   make (>= 3.80) for 'html-chunked-$(1)' in DOCS/xml/Makefile

* some corrections, as suggested Diego Biurrun
  - binary codecs should go into /usr/lib/codecs (upstream default)
  - better template 'mplayer/install_codecs'
  - an empty 'font=' in mplayer.conf breaks mplayer: postinst corrected
* correction in 'mplayer/cfgnote'
* better mplayer.postinst and mplayer.config

* New upstream release
* better debian/copyright file
* do not ship a skin
* New upstream release
* changed DEB_BUILD_OPTIONS to DEB_BUILD_CONFIGURE ,
  DEB_BUILD_OPTIONS is used as in debian policy
* use gcc-3.4
* changed xlibs-dev to a long list of dependencies, for Debian/etch
* try to adhere to  http://www.mplayerhq.hu/DOCS/tech/binary-packaging.txt
  (see README.Debian for details)
* removed dependency on xlibmesa-dev, disabled opengl
* New upstream release
* Simon McVittie <hacks@pseudorandom.co.uk> wonderful work:
- Work around Debian bug #267442 (glibc's sys/uio.h and gcc's altivec.h have
  conflicting uses for __vector) by re-ordering #includes
- Fix potential symlink attack in ./configure
- Disable support for binary codecs on platforms for which those codecs
  aren't available; also disable the corresponding Debconf note when it's
  inappropriate
- Changed Build-Depends: so it works in pbuilder
- Explicitly build-depend on libjpeg62-dev, libfontconfig1-dev,
  libungif4-dev 
- Tweak debian/rules to avoid certain errors being ignored
- Use --language=all
* provide a target  'debian/rules get-orig-source' 
  that recreates the orig.tar.gz ; then use the above orig.tar.gz
* rewrote some parts of debian/rules
* don't clean and recompile docs if upstream ships them
* mplayer-doc was shipping too much stuff
* translated man pages where not installed properly
* compile with libdv4-dev
* correct README.Debian
* Forgot build-dep on libtheora
* Must not depend on libxvidcore
* New upstream release
* new release.
* rc1 to become 0.90
* new pre-release
* new pre-release
* gtk bug fixed.
* new release.
* version bumped
* 0.60 pre2 release
* 0.60 pre-release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
#include "avutil.h"
30
30
#include "eval.h"
 
31
#include "log.h"
31
32
 
32
33
typedef struct Parser {
33
34
    const AVClass *class;
122
123
        e_mod, e_max, e_min, e_eq, e_gt, e_gte,
123
124
        e_pow, e_mul, e_div, e_add,
124
125
        e_last, e_st, e_while, e_floor, e_ceil, e_trunc,
 
126
        e_sqrt, e_not,
125
127
    } type;
126
128
    double value; // is sign in other types
127
129
    union {
148
150
        case e_floor:  return e->value * floor(eval_expr(p, e->param[0]));
149
151
        case e_ceil :  return e->value * ceil (eval_expr(p, e->param[0]));
150
152
        case e_trunc:  return e->value * trunc(eval_expr(p, e->param[0]));
 
153
        case e_sqrt:   return e->value * sqrt (eval_expr(p, e->param[0]));
 
154
        case e_not:    return e->value * eval_expr(p, e->param[0]) == 0;
151
155
        case e_while: {
152
156
            double d = NAN;
153
157
            while (eval_expr(p, e->param[0]))
282
286
    else if (strmatch(next, "floor" )) d->type = e_floor;
283
287
    else if (strmatch(next, "ceil"  )) d->type = e_ceil;
284
288
    else if (strmatch(next, "trunc" )) d->type = e_trunc;
 
289
    else if (strmatch(next, "sqrt"  )) d->type = e_sqrt;
 
290
    else if (strmatch(next, "not"   )) d->type = e_not;
285
291
    else {
286
292
        for (i=0; p->func1_names && p->func1_names[i]; i++) {
287
293
            if (strmatch(next, p->func1_names[i])) {
449
455
        case e_floor:
450
456
        case e_ceil:
451
457
        case e_trunc:
 
458
        case e_sqrt:
 
459
        case e_not:
452
460
            return verify_expr(e->param[0]);
453
461
        default: return verify_expr(e->param[0]) && verify_expr(e->param[1]);
454
462
    }
460
468
                  const char * const *func2_names, double (* const *funcs2)(void *, double, double),
461
469
                  int log_offset, void *log_ctx)
462
470
{
463
 
    Parser p;
 
471
    Parser p = { 0 };
464
472
    AVExpr *e = NULL;
465
473
    char *w = av_malloc(strlen(s) + 1);
466
474
    char *wp = w;
488
496
    if ((ret = parse_expr(&e, &p)) < 0)
489
497
        goto end;
490
498
    if (*p.s) {
 
499
        av_expr_free(e);
491
500
        av_log(&p, AV_LOG_ERROR, "Invalid chars '%s' at the end of expression '%s'\n", p.s, s0);
492
501
        ret = AVERROR(EINVAL);
493
502
        goto end;
505
514
 
506
515
double av_expr_eval(AVExpr *e, const double *const_values, void *opaque)
507
516
{
508
 
    Parser p;
 
517
    Parser p = { 0 };
509
518
 
510
519
    p.const_values = const_values;
511
520
    p.opaque     = opaque;
532
541
 
533
542
#ifdef TEST
534
543
#undef printf
 
544
#include <string.h>
 
545
 
535
546
static double const_values[] = {
536
547
    M_PI,
537
548
    M_E,
544
555
    0
545
556
};
546
557
 
547
 
int main(void)
 
558
int main(int argc, char **argv)
548
559
{
549
560
    int i;
550
561
    double d;
555
566
        "-PI",
556
567
        "+PI",
557
568
        "1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)",
558
 
        "80G/80Gi"
 
569
        "80G/80Gi",
559
570
        "1k",
560
571
        "1Gi",
561
572
        "1gi",
596
607
        "trunc(-123.123)",
597
608
        "ceil(123.123)",
598
609
        "ceil(-123.123)",
 
610
        "sqrt(1764)",
 
611
        "isnan(sqrt(-1))",
 
612
        "not(1)",
 
613
        "not(NAN)",
 
614
        "not(0)",
599
615
        NULL
600
616
    };
601
617
 
616
632
                           NULL, NULL, NULL, NULL, NULL, 0, NULL);
617
633
    printf("%f == 0.931322575\n", d);
618
634
 
619
 
    for (i=0; i<1050; i++) {
620
 
        START_TIMER
 
635
    if (argc > 1 && !strcmp(argv[1], "-t")) {
 
636
        for (i = 0; i < 1050; i++) {
 
637
            START_TIMER;
621
638
            av_expr_parse_and_eval(&d, "1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)",
622
639
                                   const_names, const_values,
623
640
                                   NULL, NULL, NULL, NULL, NULL, 0, NULL);
624
 
        STOP_TIMER("av_expr_parse_and_eval")
 
641
            STOP_TIMER("av_expr_parse_and_eval");
 
642
        }
625
643
    }
 
644
 
626
645
    return 0;
627
646
}
628
647
#endif