Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The StreamBlanker pipeline is always built #126

Closed
DavidVentura opened this issue Mar 14, 2017 · 1 comment
Closed

The StreamBlanker pipeline is always built #126

DavidVentura opened this issue Mar 14, 2017 · 1 comment

Comments

@DavidVentura
Copy link
Contributor

DavidVentura commented Mar 14, 2017

Setting

[stream-blanker]
enabled=false

doesn't work. The pipeline gets created anyway. Also, deleting sources=... from the stream-blanker when it's disabled fails

Traceback (most recent call last):
  File "./voctocore/voctocore.py", line 100, in <module>
    main()
  File "./voctocore/voctocore.py", line 94, in main
    voctocore = Voctocore()
  File "./voctocore/voctocore.py", line 50, in __init__
    self.pipeline = Pipeline()
  File "/var/voctomix/voctocore/lib/pipeline.py", line 110, in __init__
    self.streamblanker = StreamBlanker()
  File "/var/voctomix/voctocore/lib/streamblanker.py", line 16, in __init__
    self.names = Config.getlist('stream-blanker', 'sources')
  File "/var/voctomix/voctocore/lib/config.py", line 10, in getlist
    return [x.strip() for x in self.get(section, option).split(',')]
  File "/usr/lib/python3.4/configparser.py", line 765, in get
    raise NoOptionError(option, section)
configparser.NoOptionError: No option 'sources' in section: 'stream-blanker'

I've successfully disabled the streamblanker

I can't really do a PR now but this is the diff

--- a/voctocore/lib/commands.py
+++ b/voctocore/lib/commands.py
@@ -61,7 +61,11 @@ class ControlServerCommands(object):
         self.pipeline = pipeline
 
         self.sources = Config.getlist('mix', 'sources')
-        self.blankerSources = Config.getlist('stream-blanker', 'sources')
+        self.blankerSources = []
+        try:
+            self.blankerSources = Config.getlist('stream-blanker', 'sources')
+        except:
+            pass

The blanker creation wasn't within the condition that checks if it should be enabled.

--- a/voctocore/lib/pipeline.py
+++ b/voctocore/lib/pipeline.py
@@ -106,9 +106,9 @@ class Pipeline(object):
             source = AVSource('streamblanker', port, has_video=False)
             self.sbsources.append(source)
 
-        self.log.info('Creating StreamBlanker')
-        self.streamblanker = StreamBlanker()
-
-        port = 15000
-        self.log.info('Creating StreamBlanker-Output at tcp-port %u', port)
-        self.streamout = AVRawOutput('streamblanker_out', port)
+            self.log.info('Creating StreamBlanker')
+            self.streamblanker = StreamBlanker()
+    
+            port = 15000
+            self.log.info('Creating StreamBlanker-Output at tcp-port %u', port)
+            self.streamout = AVRawOutput('streamblanker_out', port)
@Florob
Copy link
Contributor

Florob commented Mar 14, 2017

I'll take part of the blame for this. I actually noticed the stream-blanker was always enabled, when I was doing the PEP8 conversion, but forgot to follow up on it. Thank you for raising this issue.

Having looked at lib/commands.py just now, I think the changes will probably have to be a bit more involved than the two diffs you provided. In particular without a stream-blanker the get_stream_status, set_stream_blank, and set_stream_live commands don't make sense and will TB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants