Viacom CEO Philippe Dauman is out as Sumner Redstone’s health care agent, and daughter Shari Redstone is in as part of a settlement with the media mogul’s former companion in her lawsuit challenging an effort to remove her from the decision-making.

The agreement was pre-conditioned on removing Dauman from the role he assumed in October as the person in charge of Redstone’s health care decisions, according to sources.

Those close to events also tell us that the 92-year-old Redstone’s former companion Manuela Herzer will not be reinstated as his health care agent. She will get some money out of the deal — though nothing like the $50 million she once was to have received in Redstone’s will.

The deal comes two days after Deadline reported about settlement talks in the case. A trial was expected to be heard at L.A. Superior Court in May. Dauman was to have been deposed in the case Tuesday, but that was scrapped as settlement talks heated up.

Sources said “serious conversations” about a deal began in late March. Lawyers will file the formal terms of their deal at L.A. Superior Court once they’ve worked out details. Needless to say, the trial is now heading to the dead-letter office.

sumner redstone aug 2014While Redstone supposedly was set against any deal with his former companion, his daughter Shari pushed to put this matter behind the family. Her ailing father recently relinquished his active roles as Chairman of Viacom and CBS to become Chairman Emeritus. Les Moonves took over as CBS chairman.

Herzer had been charge of Redstone’s health decisions up until last fall, when she was ejected from his SoCal mansion. His longtime corporate right-hand, NY-based Dauman, signed on for the gig. Herzer charged that Redstone is a “living ghost” and was not capable of making the decision, an allegation that Dauman disputed.

Wall Street is monitoring the case closely: Redstone controls 80% of the voting shares at Viacom and CBS. The uncertainty about his state of mind — and what will happen when he passes — heightens “talk that Dauman could be displaced if [Viacom’s] turnaround initiatives are not realized,” Wunderlich Securities’ Matthew Harrigan says.

The uncertainty also contributed to a decision this week by MoffettNathanson Research’s Michael Nathanson to downgrade his view of Viacom to “neutral.”  With Dauman replacing Redstone as Executive Chairman, over Shari’s objection, changes at the entertainment giant “will take longer than we initially believed.”

Erik Pedersen contributed to this report.