Barry Diller is emerging as the pivotal figure for Vivendi and NBC to complete their merger deal.

Sources close to the deal say the merger cannot close until Vivendi unwinds its complicated partnership with Diller – and that may prove to be far more difficult than Vivendi executives have believed.

“If that is the case, then Vivendi is cooked,” said one source familiar with the details of the partnership. “Barry can make life very difficult.”

Some people close to the deal say the matter could wind up being settled in the courts, where Diller is already tussling with Vivendi over a $600 million tax payment. These sources say that the tax lawsuit, which was filed earlier this year, will likely be settled before Vivendi closes the merger with NBC.

To ink the preliminary deal with NBC, Vivendi agreed to take responsibility for negotiating an exit for Diller, sources say.

Much of the attention has focused on how Vivendi will secure some of Diller’s preferred stock in Vivendi Universal Entertainment. But Diller, both personally and through InterActiveCorp, holds a 5.4 percent equity stake in VUE, which could hamstring NBC when it seeks to cut costs in Hollywood.

For example, a major impetus for NBC to merge with Universal was to secure its valuable “Law & Order” television series, which is aired on NBC but produced by Universal. Diller, sources note, would likely insist that any deals between NBC and Universal, such as a contract extension with “Law & Order” producer Dick Wolf, occur at arm’s length.

The upshot: Rather than inking a sweetheart deal with Wolf that saves NBC money, Diller could force Universal to shop the show to other networks in order to get a fair price.

However, under one scenario being discussed, Diller could exchange his VUE equity for a minority stake in the combined NBC-Universal.

In order to combine any of the VUE assets with NBC, Vivendi will have to post a letter of credit for Diller’s $750 million worth of preferred class A shares, and sources say Vivendi has already taken out Treasury securities to do so.

But sources familiar with the details of the partnership say that T-bills are not technically a line of credit, and that Diller could make a strong legal case to stop the deal if he wanted to.

A representative for Diller declined comment, and a spokesperson for Vivendi was not immediately available for comment.

In previous comments to The Post, Diller has spoken positively about the NBC deal and said he supports it. Diller has also said many times that he has no desire to return to the entertainment business.

Still, some don’t buy it.

“People are skeptical,” said one source familiar with the matter. “I think a lot of people are worried that he’ll try to scuttle the deal.”

Sources also note that relations between Diller and Vivendi have been strained for months. In addition to the pending tax lawsuit, there’s the $237.8 million charge that InterActiveCorp had to take this year to write down the value of its share of the VUE assets.

No matter how the talks proceed, the end result is clear to many in the media industry: “Barry will get a lot of money,” said one source.

Casting a shadow

Barry Diller could be a threat to the Vivendi-NBC merger. Here’s why:

* Vivendi must unwind a partnership with Diller before the merger can be completed.