diff --git a/Makefile b/Makefile index 79258ab..7af458b 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ CONFIG := #-DDEBUG #CONFIG += -DUSE_AC3_DRIFT_CORRECTION # build new ac-3 drift code CONFIG += -DAV_INFO -DAV_INFO_TIME=3000 # debug a/v sync #CONFIG += -DHAVE_PTHREAD_NAME # supports new pthread_setname_np -CONFIG += -DUSE_TS_AUDIO # build new ts audio parser +#CONFIG += -DNO_TS_AUDIO # disable ts audio parser #CONFIG += -DUSE_TS_VIDEO # build new ts video parser CONFIG += $(shell pkg-config --exists vdpau && echo "-DUSE_VDPAU") CONFIG += $(shell pkg-config --exists libva && echo "-DUSE_VAAPI") diff --git a/Todo b/Todo index bb98285..70d0bf8 100644 --- a/Todo +++ b/Todo @@ -86,7 +86,8 @@ audio: Starting suspended and muted, didn't register the mute. Relaxed audio sync checks at end of packet and already in sync samplerate problem resume/suspend. - only wait for video buffers, if video is running. + only wait for video start, if video is running. + Not primary device, don't use and block audio/video. audio/alsa: better downmix of >2 channels on 2 channel hardware diff --git a/softhddev.c b/softhddev.c index 232ab0d..119a96a 100644 --- a/softhddev.c +++ b/softhddev.c @@ -348,7 +348,7 @@ static int Ac3Check(const uint8_t * data, int size) return 0; } -#ifdef USE_TS_AUDIO +#ifndef NO_TS_AUDIO ////////////////////////////////////////////////////////////////////////////// // PES Demux @@ -1058,7 +1058,7 @@ int PlayAudio(const uint8_t * data, int size, uint8_t id) return size; } -#ifdef USE_TS_AUDIO +#ifndef NO_TS_AUDIO /** ** Play transport stream audio packet. @@ -2369,7 +2369,7 @@ int Start(void) } pthread_mutex_init(&SuspendLockMutex, NULL); -#ifdef USE_TS_AUDIO +#ifndef NO_TS_AUDIO PesInit(PesDemuxAudio); #endif Info(_("[softhddev] ready%s\n"), ConfigStartSuspended ? " suspended" : ""); diff --git a/softhddevice.cpp b/softhddevice.cpp index 1e36cc8..1355a6c 100644 --- a/softhddevice.cpp +++ b/softhddevice.cpp @@ -832,6 +832,7 @@ eOSState cSoftHdMenu::ProcessKey(eKeys key) cControl::Attach(); Suspend(ConfigSuspendClose, ConfigSuspendClose, ConfigSuspendX11); + SuspendMode = SUSPEND_NORMAL; if (ShutdownHandler.GetUserInactiveTime()) { dsyslog("[softhddev]%s: set user inactive\n", __FUNCTION__); @@ -876,7 +877,7 @@ class cSoftHdDevice:public cDevice #ifdef USE_TS_VIDEO virtual int PlayTsVideo(const uchar *, int); #endif -#if !defined(USE_AUDIO_THREAD) || defined(USE_TS_AUDIO) +#if !defined(USE_AUDIO_THREAD) || !defined(NO_TS_AUDIO) virtual int PlayTsAudio(const uchar *, int); #endif virtual void SetAudioChannelDevice(int); @@ -986,6 +987,7 @@ bool cSoftHdDevice::SetPlayMode(ePlayMode play_mode) case pmExtern_THIS_SHOULD_BE_AVOIDED: dsyslog("[softhddev] play mode external\n"); Suspend(1, 1, 0); + SuspendMode = SUSPEND_EXTERNAL; return true; default: dsyslog("[softhddev] playmode not implemented... %d\n", play_mode); @@ -1257,7 +1259,7 @@ int cSoftHdDevice::PlayTsVideo(const uchar * data, int length) #endif -#if !defined(USE_AUDIO_THREAD) || defined(USE_TS_AUDIO) +#if !defined(USE_AUDIO_THREAD) || !defined(NO_TS_AUDIO) /// /// Play a TS audio packet. @@ -1267,7 +1269,7 @@ int cSoftHdDevice::PlayTsVideo(const uchar * data, int length) /// int cSoftHdDevice::PlayTsAudio(const uchar * data, int length) { -#ifdef USE_TS_AUDIO +#ifndef NO_TS_AUDIO return::PlayTsAudio(data, length); #else AudioPoller(); @@ -1413,6 +1415,8 @@ bool cPluginSoftHdDevice::Start(void) } if (!::Start()) { + cControl::Launch(new cSoftHdControl); + cControl::Attach(); SuspendMode = SUSPEND_NORMAL; } @@ -1463,6 +1467,7 @@ cOsdObject *cPluginSoftHdDevice::MainMenuAction(void) cControl::Launch(new cSoftHdControl); cControl::Attach(); Suspend(ConfigSuspendClose, ConfigSuspendClose, ConfigSuspendX11); + SuspendMode = SUSPEND_NORMAL; if (ShutdownHandler.GetUserInactiveTime()) { dsyslog("[softhddev]%s: set user inactive\n", __FUNCTION__); ShutdownHandler.SetUserInactive(); @@ -1491,6 +1496,7 @@ void cPluginSoftHdDevice::MainThreadHook(void) if (ShutdownHandler.IsUserInactive()) { // this is regular called, but guarded against double calls Suspend(ConfigSuspendClose, ConfigSuspendClose, ConfigSuspendX11); + SuspendMode = SUSPEND_NORMAL; } ::MainThreadHook(); @@ -1679,6 +1685,7 @@ cString cPluginSoftHdDevice::SVDRPCommand(const char *command, } // should be after suspend, but SetPlayMode resumes Suspend(ConfigSuspendClose, ConfigSuspendClose, ConfigSuspendX11); + SuspendMode = SUSPEND_NORMAL; cControl::Launch(new cSoftHdControl); cControl::Attach(); return "SoftHdDevice is suspended";