SetPlayMode() on radio channels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Klaus Schmidinger wrote:

> When replaying a recording, VDR sets up a cDvbPlayerControl in
> cReplayControl::cReplayControl(), which in turn creates a cDvbPlayer.
> If you want to use a different play mode for radio recordings,
> you'll need to first know in cReplayControl::cReplayControl() that
> this actually is an audio-only recording, and then hand down the
> desired play mode to the cPlayer.

For the radio plugin I've contributed the following code which detects
whether a VDR recording (given by FileName) is a radio recording.

        bool isRadio = false;

        cFileName fn(FileName, false, true);
        cUnbufferedFile *f = fn.Open();
        if (f) {
            uchar b[4] = { 0x00, 0x00, 0x00, 0x00 };
            ReadFrame(f, b, sizeof (b), sizeof (b));
            fn.Close();
            isRadio = (b[0] == 0x00) && (b[1] == 0x00) && (b[2] == 0x01)
&& (0xc0 <= b[3] && b[3] <= 0xdf);
            }

As video recordings always start with a video PES packet, testing for an
audio PES packet should be sufficient.

Bye.
-- 
Dipl.-Inform. (FH) Reinhard Nissl
mailto:rnissl@xxxxxx


[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux