On Thu, Feb 08, 2007 at 10:26:00AM +0200, Marko Mäkelä wrote:
> On Thu, Feb 08, 2007 at 08:50:00AM +0100, Stefan Lucke wrote:
> > Transferring() was introduced in vdr-1.3.42. So this needs an extra #if
> > # if VDRVERSNUM >= 10342
> >
> > Looking at the implementation of Transferring() in device.c I'm just
> > wondering of the difference compared to Replaying()
> > !Transferring() == true -> no player (player == NULL) or
> > player is not derived from cTransfer.
> >
> > device.c around line 948:
> >
> > bool cDevice::Replaying(void) const
> > {
> > return player != NULL;
> > }
> >
> > bool cDevice::Transferring(void) const
> > {
> > return dynamic_cast<cTransfer *>(player) != NULL;
> > }
>
> It seems to me that Replaying() would always return true when called
> from cSoftDevice::PlayVideo() or PlayAudio(). I would guess that
> player != NULL when playing a recording or a live stream.
>
> Are you suggesting that we should replace Transferring()
> with dynamic_cast<cTransfer*>(player) to avoid the VDRVERSNUM check?
Hmm, the dynamic_cast won't work, because player is a private member of
cDevice.
> There is another method that could possibly be used, something like
> cPlayerControl::NowReplaying(). I don't have the source tree at hand
> right now, but I can check it tonight.
cReplayControl::NowReplaying() looks efficient: a static method that
references two static variables. I tried replacing !Transferring()
with cReplayControl::NowReplaying(), and it works.
Conclusion: use !Transferring() with an appropriate VDRVERSNUM check.
Or does softdevice need to support the old development version of vdr?
The stable 1.4 series has been around for a while now.
Marko
_______________________________________________
Softdevice-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/softdevice-devel