TvControl.User() is not proper (1 Viewer)

binary64

Portal Pro
July 30, 2006
105
1
I'm using the latest-but-one tv server (not MP client).

If I do: (cross posted from this *post* on https://forum.team-mediaportal.com/...estions-about-tvengine3-api-39424/#post268121 thread)

user = new TvControl.User("Test", true);
result = TvControl.RemoteControl.Instance.StartTimeShifting (ref user, 33, out card);
result = TvControl.RemoteControl.Instance.StartTimeShifting (ref user, 33, out card);
result = TvControl.RemoteControl.Instance.StartTimeShifting (ref user, 33, out card);

the results are: NoVideoAudioDetected, UnknownChannel, UnknownChannel (incorrect/bug imo)

note: the channelid 33 is off-air

However,
user = new TvControl.User("Test", true);
result = TvControl.RemoteControl.Instance.StartTimeShifting (ref user, 33, out card);
user = new TvControl.User("Test", true);
result = TvControl.RemoteControl.Instance.StartTimeShifting (ref user, 33, out card);
user = new TvControl.User("Test", true);
result = TvControl.RemoteControl.Instance.StartTimeShifting (ref user, 33, out card);

the results are: NoVideoAudioDetected, NoVideoAudioDetected, NoVideoAudioDetected (correct imo)

The reason I'm doing this, is when user idles on an off-air channel, i am polling it every few seconds so that when the channel finally comes back on air, it immedately starts playing.

Thanks!

Update:

[16:30] <binary64_> just been looking more into this TvControl.User problem/bug
[16:31] <binary64_> if (new User("fred", true) != new User("fred", true)) { MessageBox.Show("this fires, wrongfully imho"); }
[16:32] <binary64_> same happens with .Equals() as well as if user is not Admin
[16:32] <binary64_> ^-- that's the core of the problem, as far as i've found
[16:32] <binary64_> some knock on effects are:
[16:32] <binary64_> 1. if i do new User() before every timeshift, tvserver crashes after a few
[16:33] <binary64_> 2. with same user, tuning into same channel gives UnknownChannel (it is known)
[16:33] <tontsa> yeah it's a mess
[16:33] <binary64_> 3. a reboot or client crash means problem #1
[16:34] <binary64_> can't we just override the equality operator?
[16:34] <binary64_> also, makes no difference if i StopTimeshifting before starting
[16:34] <binary64_> can this be mantis'ed please? i think i've done a fair amount of pre-research into it
[16:35] <binary64_> instead of letting .net compare the two objects.. make it compare the Username string inside
[16:35] <tontsa> is there some coherent forum thread about it?
[16:35] <binary64_> no, only part of another thread (confusing)
[16:35] <binary64_> i'll start one now
 

binary64

Portal Pro
July 30, 2006
105
1
another bug..

i watched tv on my custom client a bit. it sends heartbeat every 9 secs. i terminated the client. then 30 mins later loaded it again. of course it uses the same string username. but this time, IController::GetTvStoppedReason was returning HeartBeatTimeOut - even after multiple beats sent by 2nd load. it went away after a channel change.

this could point to the fact that some code does if (user1.Name == user2.Name) and some does if (user1 == user2)
 

gibman

Retired Team Member
  • Premium Supporter
  • October 4, 2006
    2,998
    1,372
    Usa
    Home Country
    Ethiopia Ethiopia
    Why not try and root out where the user == user if statements are located and let us know - by attaching a diff. or patch file.
    This would help a lot.
    maybe override the equals method.

    /gibman
     

    Users who are viewing this thread

    Top Bottom