How do you solve a problem like Viacom Inc.?

The cable network conglomerate is still a far cry from its glory days as the future of cable TV, its latest quarterly report reveals. Overall revenue was down 3 percent for the first three months of 2016 compared with the first three months of 2015, at a little less than $3 billion. Advertising revenue is still down, despite a strong overall TV ad market. And while ratings declines have been abating at some of its networks, such as BET and VH1, the steady slide into the land of ever-diminishing fractions continues at others, such as Comedy Central and MTV.

Because Viacom actually beat Wall Street estimates, however, its stock isn’t taking the nosedive in trading Thursday an unexpected miss might have precipitated.

Meanwhile, the company isn’t going gentle into that good night.

As Viacom did in the previous quarter, it announced a strategic advertising partnership at the same time it released its financial results, attempting to remind investors that there’s more to the future than just live TV ratings — although Chairman and CEO Philippe Dauman still talked at length about the company’s big pool of young eyeballs during its earnings conference call Thursday morning.

In January, Snapchat was the lucky belle on Viacom’s arm, agreeing to allow the company to sell its ad inventory. This time around, it was Roku’s turn.

Roku allows customers to access TV shows and other video content through applicationlike channels on its internet-connected devices, à la Amazon Fire TV or Apple TV. These connected devices are becoming staples in the home: Almost two-thirds of U.S. households have something like Roku, Chromecast or Blu-ray players hooked up to their TV sets, according to Leichtman Research Group (LRG) data. And Roku alone is forecasted to have 25 million U.S. users by the end of this year, the research firm eMarketer reported.

Viacom’s deal with Roku gives the media company access to Roku’s audience data, meaning Viacom can offer advertisers as much niche targeting as they desire. Want to make sure the people who see your car commercial are in the market for a new vehicle? Can do.

While the current idea is for Viacom to use these data to target people who are just watching its own channels on Roku, a company representative said it is possible Viacom will be involved in more general Roku ad sales in the future, expanding into other content on the device.

Viacom, it should be noted, made a $45.5 million investment in Roku in February.

While not industry-shattering, the deal is cause for at least some concern for pay-TV companies, sources contended. Your cable provider gets around two minutes of commercial time per hour, per channel, to sell for itself. Roku still isn’t quite big enough to cause a headache by stealing eyeballs, one pay-TV source said, but it is an irritation that could begin to siphon off some advertising dollars — or at least start to boost the competition over them.

Even just a few months ago, that could have spelled bad news for Viacom, which still relies on the pay-TV industry for most of its distribution. But, fortunately for Viacom, the company has emerged from a lengthy gauntlet of carriage negotiations with the biggest pay-TV providers, and so its future, at least for the next several years, is secure: The providers will merely have to adjust, as they did when networks began putting their programming online 10 years ago. There’s also encouraging data from LRG that indicate more households with connected devices pay for cable or satellite TV (83 percent) than those without connected devices (81 percent).

Analysts were unimpressed, though. “We believe that the only way for Viacom to change the current narrative is to show meaningful acceleration in affiliate fee growth,” MoffettNathanson analyst Michael Nathanson wrote in a note to investors Thursday. “Given our concerns on the industry as a whole, we remain skeptical that this can be achieved.”