Reply to thread

Hi frodo,


thanks for looking into the code.


Ok, let me explain, what happens on my machine without the patch.


1) PVR 350 standalone (150 taken out of comp)

- works fine


2) PVR 150 standalone (350 taken out of comp)

- works fine


3) PVR 150 together with PVR 350

- PVR 150 works fine

- PVR 350 does not work. I get a black picture and an error message in error.log:

23.11.2005 23:14:39 SinkGraph:FAILED to connect Encoder->mpeg2 demuxer:80040217


Looking at the graphs i can see that MP picks the filters of the PVR 150 for the PVR 350.


Moniker of PVR 150:

ven_4444&dev_0016&subsys_88010070&rev_01

Moniker of PVR 350:

ven_4444&dev_0803&subsys_40000070&rev_01


Taking a look into the mediaportal.log I can see that MP takes the 150-moniker as unique filter for the PVR 350.

(sorry no log here, i am at work)


This is because the foreach-loop is simply wrong. (In my eyes ;))

[code]foreach (string key in AvailableFilters.Filters.Keys)[/code]

- This loop takes all available filter, so far so good. I have two of them (150/350).

[code]filter = al[0] as Filter; // TAKES the first filter

string filterMoniker = filter.MonikerString;

int posTmp = filterMoniker.LastIndexOf("#");

if (posTmp >= 0) filterMoniker = filterMoniker.Substring(0, posTmp);[/code]

- In this part the very first filter-moniker is read in. In my case PVR 150, because it is the first in the list. This code part does not make sense.


Why? In the following for-loop this filter-moniker is compared to the first filter-moniker. So it will be compared to itself! MP will always find the unique filter in the first run of the for-loop. It reads the first filter and compares it to its own...


[code]string moniker = FindUniqueFilter(filterMoniker, Instance);

for (int filterInst = 0; filterInst < al.Count; ++filterInst)

{

 filter = al[filterInst] as Filter; // TAKES the first filter

 string tmpMoniker = filter.MonikerString.Replace(@"\", "#");

 tmpMoniker = tmpMoniker.Replace(@"/", "#");

  // COMPARES first filter with first filter -> always TRUE

 if (tmpMoniker.ToLower().IndexOf(moniker.ToLower()) >= 0)

 {

   Log.Write("use unique filter moniker:{0}", filter.MonikerString);

   filterFound = true; 

   break;

 }

}[/code]


If I use this code

[code]string moniker = FindUniqueFilter(captureDeviceDeviceName, Instance);[/code]

this comparision

[code]if (tmpMoniker.ToLower().IndexOf(moniker.ToLower()) >= 0)[/code]

will only be true if the filter-moniker is the same like the given one in the CaptureCardsDefinition.xml


I do not know, if this will cause problems with TwinHan cards, but I do not think so. The code will still compare the moniker of the definition file with the moniker of the filter.


But I know, that the current code does not work with multiple PVR cards. My patch does work. :)


Hopefully this makes sense. Just ask back, if there are any questions left. I will try to go on IRC this evening. Have to go back to work now... ;)


Flip.


Top Bottom