SAN FRANCISCO (AP) - Yahoo is buying digital video advertising service BrightRoll for $640 million in the Internet company's latest attempt to boost its revenue after years filled mostly with financial futility. The acquisition announced Tuesday marks Yahoo's first major purchase since reaping a $9.4 billion windfall in September by selling part of its stake in a rapidly rising Internet star, Chinese e-commerce service Alibaba Group Holding Ltd. Yahoo Inc. has promised to distribute at least half of the $6.3 billion in after-tax proceeds from the Alibaba stake sale to its shareholders. That gives CEO Marissa Mayer the option of spending the rest on acquisitions that could enable the Sunnyvale, California, company to recover some of the ground that it has lost to rivals Google Inc. and Facebook Inc. in the booming online ad market. BrightRoll, based in San Francisco, helps to automatically place ads in videos displayed on personal computers and mobile devices. Since its founding in 2006, it has built relationships with most of the biggest advertisers in the U.S., helping the service generate more than $100 million in annual revenue, according to Yahoo. That makes the BrightRoll deal look quite different from the only larger acquisition that Yahoo has made since hiring Mayer as its CEO in July 2012. Mayer bought online blogging service Tumblr for $1.1 billion last year, even though that New York company hadn't yet proven it could make money. In contrast, BrightRoll already is profitable, according to Yahoo. Meanwhile, Tumblr isn't expected to bring in $100 million in annual revenue until next year, at the earliest. "Acquiring BrightRoll will dramatically strengthen Yahoo's video advertising platform," Mayer predicted in a Tuesday blog post. Investors didn't seem to be as enthusiastic about the deal. Yahoo's stock dipped 3 cents to $49.02 in extended trading. If Mayer is right, BrightRoll could help Yahoo reverse a long-running decline in display advertising - a category consisting of video pitches and other marketing with a visual element. Through the first nine months of this year, Yahoo's display advertising revenue had declined 4 percent from last year to $1.2 billion after subtracting commissions. Meanwhile, ad revenue at Google and Facebook has been steadily rising by 20 percent or more in most quarters as marketers pour money into digital campaigns to connect with consumers spending more time gazing into screens on PCs and mobile devices. Yahoo's share of the worldwide ad market now stands at about 2.4 percent, down from 3.9 percent in 2011, according to the research firm eMarketer. Facebook's share has climbed from 3.6 percent in 2011 to a projected 8 percent this year while Google has held on to a 32 percent share of a much larger market. "This plugs a hole for (Yahoo)," said Outsell analyst Randy Giusto. They obviously needed to do something. Mayer is under more pressure to get Yahoo rolling in the right direction now that the company has brought in more money from its recent sale of Alibaba stock. What's more, Yahoo still owns 384 million shares of Alibaba stock currently worth $44 billion. The Alibaba holdings are the main reason that Yahoo's stock has been hovering around its highest levels in more than 14 years. Activist shareholder Starboard Value LP issued a challenge to Mayer in September in a letter critical of the more than 30 acquisitions that she had previously made for a total of about $1.6 billion. Those acquisitions seemed to make little financial sense, according to Starboard, which urged Mayer to consider buying rival AOL Inc. as a way to save money and bring in more ad revenue. Yahoo so far hasn't given any indication that it's interested in joining forces with AOL, which currently has a market value of about $3.5 billion. Mayer has said that Yahoo is considering ways to minimize taxes on future sales of its Alibaba stock, a step that Starboard had also implored the company to consider. Starboard didn't immediately respond to requests for comment about the BrightRoll acquisition.