summaryrefslogtreecommitdiff
path: root/dvbdevice.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2002-09-08 15:04:33 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2002-09-08 15:04:33 +0200
commitc40fdb05a36355e30fe4a406ae65073f98a7cc1e (patch)
tree4a84261966a59ceb40f8a5e5170f7ef101dccb23 /dvbdevice.c
parent706a6e1beb322c2681b6252a93c3577e7d306d9c (diff)
downloadvdr-c40fdb05a36355e30fe4a406ae65073f98a7cc1e.tar.gz
vdr-c40fdb05a36355e30fe4a406ae65073f98a7cc1e.tar.bz2
Added play mode pmAudioOnlyBlack1.1.9
Diffstat (limited to 'dvbdevice.c')
-rw-r--r--dvbdevice.c37
1 files changed, 25 insertions, 12 deletions
diff --git a/dvbdevice.c b/dvbdevice.c
index 2b9c0aae..a1301124 100644
--- a/dvbdevice.c
+++ b/dvbdevice.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: dvbdevice.c 1.12 2002/09/08 14:07:08 kls Exp $
+ * $Id: dvbdevice.c 1.13 2002/09/08 15:00:46 kls Exp $
*/
#include "dvbdevice.h"
@@ -663,11 +663,12 @@ bool cDvbDevice::SetPlayMode(ePlayMode PlayMode)
siProcessor->SetStatus(true);
break;
case pmAudioVideo:
+ case pmAudioOnlyBlack:
if (siProcessor)
siProcessor->SetStatus(false);
CHECK(ioctl(fd_video, VIDEO_SET_BLANK, true));
CHECK(ioctl(fd_audio, AUDIO_SELECT_SOURCE, AUDIO_SOURCE_MEMORY));
- CHECK(ioctl(fd_audio, AUDIO_SET_AV_SYNC, true));
+ CHECK(ioctl(fd_audio, AUDIO_SET_AV_SYNC, PlayMode == pmAudioVideo));
CHECK(ioctl(fd_audio, AUDIO_PLAY));
CHECK(ioctl(fd_video, VIDEO_SELECT_SOURCE, VIDEO_SOURCE_MEMORY));
CHECK(ioctl(fd_video, VIDEO_PLAY));
@@ -711,18 +712,30 @@ void cDvbDevice::Clear(void)
void cDvbDevice::Play(void)
{
- if (fd_audio >= 0)
- CHECK(ioctl(fd_audio, AUDIO_SET_AV_SYNC, true));
- if (fd_video >= 0)
- CHECK(ioctl(fd_video, VIDEO_CONTINUE));
+ if (playMode == pmAudioOnly || playMode == pmAudioOnlyBlack) {
+ if (fd_audio >= 0)
+ CHECK(ioctl(fd_audio, AUDIO_CONTINUE));
+ }
+ else {
+ if (fd_audio >= 0)
+ CHECK(ioctl(fd_audio, AUDIO_SET_AV_SYNC, true));
+ if (fd_video >= 0)
+ CHECK(ioctl(fd_video, VIDEO_CONTINUE));
+ }
}
void cDvbDevice::Freeze(void)
{
- if (fd_audio >= 0)
- CHECK(ioctl(fd_audio, AUDIO_SET_AV_SYNC, false));
- if (fd_video >= 0)
- CHECK(ioctl(fd_video, VIDEO_FREEZE));
+ if (playMode == pmAudioOnly || playMode == pmAudioOnlyBlack) {
+ if (fd_audio >= 0)
+ CHECK(ioctl(fd_audio, AUDIO_PAUSE));
+ }
+ else {
+ if (fd_audio >= 0)
+ CHECK(ioctl(fd_audio, AUDIO_SET_AV_SYNC, false));
+ if (fd_video >= 0)
+ CHECK(ioctl(fd_video, VIDEO_FREEZE));
+ }
}
void cDvbDevice::Mute(void)
@@ -760,13 +773,13 @@ void cDvbDevice::StillPicture(const uchar *Data, int Length)
bool cDvbDevice::Poll(cPoller &Poller, int TimeoutMs)
{
- Poller.Add(playMode == pmAudioOnly ? fd_audio : fd_video, true);
+ Poller.Add((playMode == pmAudioOnly || playMode == pmAudioOnlyBlack) ? fd_audio : fd_video, true);
return Poller.Poll(TimeoutMs);
}
int cDvbDevice::PlayVideo(const uchar *Data, int Length)
{
- int fd = playMode == pmAudioOnly ? fd_audio : fd_video;
+ int fd = (playMode == pmAudioOnly || playMode == pmAudioOnlyBlack) ? fd_audio : fd_video;
if (fd >= 0)
return write(fd, Data, Length);
return -1;