Rubber Ducky, you were almost sunk.

There’s a good chance that without HBO stepping in to fund and air Sesame Street, the 45-year-old education show for preschoolers and home to Bert, Ernie, Elmo, Oscar and the world’s favorite 8-foot-tall bird might have been blocked for good.

On Thursday, the two companies announced a five-year deal that not only places longtime partner PBS as the second distribution channel, but gives Sesame Street the wherewithal to double the number of shows per season, launch a second show and offers the option of a third pilot and possible production. It also enforces a nine-month hold window before PBS will see another piece of brand-new Sesame Street content.

"We had a huge production deficit," said Jeff Dunn, who took over as CEO of Sesame Workshop, which produces the show, in October 2014. He also inherited a beloved children’s show with some intractable problems.

"Financially, we had been incurring losses for a number of years," Dunn told Mashable. Much of it was the result of sea changes in viewership and, especially, how Sesame Street’s youthful audience consumed the show.

Throughout much of the '80s, '90s and the early part of this century, children would watch Sesame Street on PBS stations around the country and then their parents would buy the video cassettes or DVDs so they could watch it again and again.

"What people don’t understand is that PBS only funds less than 10% of production costs of show. The show was funded for many years by licensing income," said Dunn.

The advent of digital on-demand for all kinds of children’s content — educational and otherwise — has had a profound effect ton Sesame Street’s bottom line; since 2008 it has lost more than half of its licensing income.

PBS VP of Corporate Communication Anne Bentley made it clear that viewing habits, even among those who’ve stuck with linear TV, have changed as well. Sesame Street is not among the top four most-watched educational series among children ages 2 to 5. According to PBS, that list includes Curious George, Daniel Tiger’s Neighborhood, Dinosaur Train and the math show Peg + Cat.

As the contract between the two parties was ending, Sesame Street and PBS sat down to talk about the future of the show. PBS understood the predicament, but, according to Dunn, simply didn’t have the ability to increase production funding. PBS noted that, despite talking with them about various possibilities, Sesame Street made its own decision.

Sesame Street had, Dunn said, three options: Leave PBS entirely, shut down production or find somebody who was willing to fund the show.

"We had to find another revenue source," recalled Dunn. So they looked “where [the audience] had already moved to and where they’re spending their money."

Sesame Street talked to all the major players, but many were turned off by one of core requirements: the shows had to remain freely available on PBS.

HBO, Dunn said, got it and was fully supportive.

Caveat

HBO’s terms were pretty simple: We fund the production of the show and you let us have it exclusively for the first nine months. After that, PBS can air it for free. HBO would not reveal the financial details of the deal, which is for domestic content only and has no bearing on any of the international Sesame Street franchises.

Despite that gap between old content and new, PBS’s Bentley assured Mashable “The show will continue uninterrupted. We’re not holding anything. This is not a hiatus for nine months.” Sesame Street fans will still find the show airing every weekday at 10 a.m. on their local PBS station.

And it’s unlikely they will notice anything amiss. "The episodes of Sesame Street have always been a mix of content that has already appeared with new content that’s mixed. That will continue to be the case," said Bentley.

That said, for the first time in their 45-year relationship, PBS will open a Sesame Street season on Nov. 16 without any never-before-seen Sesame Street content. They won’t have new clips for at least nine months.

When the new shows do start arriving, though, PBS could end up with more Sesame Street content than it has ever had before and that would be a direct result of the HBO deal.

During a typical Sesame Street season, PBS airs 44 shows, only 18 of which are completely new episodes.

“HBO asked us, ‘How much new content are you making today?'" remembered Dunn. The cable and on-demand network wanted to do more. In fact, they’re doubling the number of new episodes, launching a new education show and have the option of producing a third new series.

PBS gets it all for free under the same terms and conditions, which means they still have to wait nine months after any of it has run on HBO.

"They get content quicker as a result of this deal with HBO, because with PBS we could not afford to make as much new content," said Dunn.

Sesame Street, however, is in the midst of a transition. Some original cast members have left, new ones have been added and the street set itself has undergone an overhaul. For a time, there will be a distinct visual difference between the Sesame Street airing on PBS and what appears on HBO.

Dunn isn't convinced that will matter. "Three-year-olds do not care what episode it is. It doesn’t matter if you’re watching a new or old episode… The idea that kids have to watch the same show at the same time to have the same educational advantages is categorically untrue."

Profit motive

While a marriage between the non-profit Sesame Street and for-profit HBO (which is owned by Time Warner) would seem unorthodox, it’s not the first such union for Sesame Street.

Sesame Street has long sought out additional distribution channels. It already has a deal with the 24-hour preschool network Sprout (a for-profit entity). In that instance, PBS imposes a 2-year window before original episodes can air on the Sprout network.

The difference this time is that PBS, a free network that’s still available over the air and on most basic cable packages, is losing its first-run rights. HBO is premium content that lives behind a paywall.

Does this cut off low-income children who might need Sesame Street’s educational guidance the most? Even by Sesame Street’s own measure, a third of its audience is still watching the show on linear networks. Many of them might still be relying on the show for their preschool education needs. A 2012 Annie E. Casey foundation report said 53% of children between the ages of 3 and 4 do not attend preschool (for Hispanic children, the numbers are even worse).

"They do not have to buy HBO. They’re going to be able to get it on PBS," contends Dunn. "No one is forcing anyone to buy HBO, it’s a convenience for people who want to watch it on demand."

As for HBO, the company tells Mashable it knows it’s "playing a role in keeping the show going [and is] incredibly proud of that role."

It did confirm that there are currently no plans to offer an unbundled HBO Kids, where Sesame Street shows will air.

PBS’s Bentley wouldn’t comment on whether or not the changes bother anyone at PBS. Instead she said, "we’re intensely focused on building out our PBS kids properties. We know they’re making a difference in kids’ lives."

The reaction, Dunn told Mashable, has been pretty positive across the board. No outraged groups have contacted Sesame Street and the mood across the Sesame Workshop origination has been upbeat. “People recognized that companies that don’t adapt to changing times fade away and become irrelevant,” he said.

“It’s important to us to control our destiny and go forward to a bright future and that meant adapting to the times,” added Dunn.

Is PBS concerned about other shows following Sesame Street to HBO-like services? Bentley didn't answer directly but said PBS works closely with the producers of all of these shows and "they’re all very committed to developing age-appropriate content that meets our educational standard and supports the needs of kids."

Sesame's Dunn, however, was a bit more direct and believes that the declining licensing revenue is impacting other kids' shows, which are managing costs by moving production offshore. "We have not done that," he said. Then he added, somewhat ominously: "Everyone will have to define in the future how they will replace lost income."