~ubuntu-branches/ubuntu/vivid/gnash/vivid

« back to all changes in this revision

Viewing changes to libcore/movie_root.cpp

  • Committer: Package Import Robot
  • Author(s): Dimitri John Ledkov
  • Date: 2014-06-20 11:25:58 UTC
  • mfrom: (1.1.21) (3.1.34 sid)
  • Revision ID: package-import@ubuntu.com-20140620112558-rge2xst0g7a6e11i
Tags: 0.8.11~git20140419-1ubuntu1
* Sync from Debian, with a following modification:
* Build-depend on firefox-dev, instead of xulrunner-dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1626
1626
        MovieClip *mc = getLevel(0);
1627
1627
        int loaded = mc->get_bytes_loaded();
1628
1628
        int total = mc->get_bytes_total();
1629
 
        as_value val((loaded/total) * 100);
 
1629
        int percent = 0;
 
1630
        if (total > 0) { /* avoid division by zero */
 
1631
          percent = 100 * loaded / total;
 
1632
        }
 
1633
        as_value val(percent);
1630
1634
        // PercentLoaded sends the percentage
1631
1635
        ss << ExternalInterface::toXML(val);    
1632
1636
    } else if (invoke->name == "Play") {