diff options
author | HelAu <> | 2012-01-30 17:03:15 +0100 |
---|---|---|
committer | Johns <johns98@gmx.net> | 2012-01-30 17:03:15 +0100 |
commit | ec4a899bb86389a6a85f471f164bea794b25c054 (patch) | |
tree | 1a40925efaed276e6d11e57f1ffe69a17e526059 | |
parent | dab31e2367dfcb9fd3d1d05a9682f2eac1e6da8f (diff) | |
download | vdr-plugin-softhddevice-ec4a899bb86389a6a85f471f164bea794b25c054.tar.gz vdr-plugin-softhddevice-ec4a899bb86389a6a85f471f164bea794b25c054.tar.bz2 |
Add support to start the plugin in suspended mode.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | softhddev.c | 33 |
2 files changed, 28 insertions, 12 deletions
@@ -1,5 +1,10 @@ +User HelAu +Date: Mon Jan 30 16:54:47 CET 2012 + + Add support to start the plugin in suspended mode. + User johns -Date: +Date: Mon Jan 30 15:58:21 CET 2012 Finished rewrite of video code, to support output modules. Add aspect change support to software decoder path. diff --git a/softhddev.c b/softhddev.c index 60d70c9..317864e 100644 --- a/softhddev.c +++ b/softhddev.c @@ -61,6 +61,8 @@ static char ConfigVdpauDecoder = 1; ///< use vdpau decoder, if possible #endif static char ConfigFullscreen; ///< fullscreen modus +static char ConfigStartSuspended; ///< flag to start in suspend mode +static char ConfigStartX11Server; ///< flag start the x11 server static pthread_mutex_t SuspendLockMutex; ///< suspend lock mutex @@ -894,6 +896,10 @@ uint8_t *GrabImage(int *size, int jpeg, int quality, int width, int height) */ void SetPlayMode(void) { + if (ConfigStartSuspended) { // ignore first call, if start suspended + ConfigStartSuspended = 0; + return; + } Resume(); if (MyVideoDecoder) { if (VideoCodecID != CODEC_ID_NONE) { @@ -1079,8 +1085,6 @@ void OsdDrawARGB(int x, int y, int height, int width, const uint8_t * argb) ////////////////////////////////////////////////////////////////////////////// -static char ConfigStartX11Server; ///< flag start the x11 server - /** ** Return command line help string. */ @@ -1091,7 +1095,7 @@ const char *CommandLineHelp(void) " -d display\tdisplay of x11 server (fe. :0.0)\n" " -f\t\tstart with fullscreen window (only with window manager)\n" " -g geometry\tx11 window geometry wxh+x+y\n" - " -x\t\tstart x11 server\n"; + " -x\t\tstart x11 server\n" " -s\t\tstart in suspended mode\n"; } /** @@ -1106,7 +1110,7 @@ int ProcessArgs(int argc, char *const argv[]) // Parse arguments. // for (;;) { - switch (getopt(argc, argv, "-a:p:d:fg:x")) { + switch (getopt(argc, argv, "-a:p:d:fg:xs")) { case 'a': // audio device AudioSetDevice(optarg); continue; @@ -1130,6 +1134,9 @@ int ProcessArgs(int argc, char *const argv[]) case 'x': // x11 server ConfigStartX11Server = 1; continue; + case 's': // start in suspend mode + ConfigStartSuspended = 1; + continue; case EOF: break; case '-': @@ -1311,15 +1318,19 @@ void Start(void) } CodecInit(); - // FIXME: AudioInit for HDMI after X11 startup - AudioInit(); - MyAudioDecoder = CodecAudioNewDecoder(); - AudioCodecID = CODEC_ID_NONE; + if (!ConfigStartSuspended) { + // FIXME: AudioInit for HDMI after X11 startup + AudioInit(); + MyAudioDecoder = CodecAudioNewDecoder(); + AudioCodecID = CODEC_ID_NONE; - if (!ConfigStartX11Server) { - StartVideo(); + if (!ConfigStartX11Server) { + StartVideo(); + } + } else { + SkipVideo = 1; + SkipAudio = 1; } - pthread_mutex_init(&SuspendLockMutex, NULL); } |