Skip to content

Commit

Permalink
Add Drift compensation for vlc input
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Feb 8, 2016
1 parent be3679d commit ef5be73
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
9 changes: 5 additions & 4 deletions config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,14 @@ def __init__(self,config_file, logger):
# Source configuration
if self.source_type == 'alsa':
self.source_device = self.ConfigSectionMap('source')['device']
if self.ConfigSectionMap('source')['driftcomp'].upper() == 'TRUE':
self.source_driftcomp = True
else:
self.source_driftcomp = False
if self.source_type == 'stream':
self.source_url = self.ConfigSectionMap('source')['url']
self.source_volume = self.ConfigSectionMap('source')['volume']

if self.ConfigSectionMap('source')['driftcomp'].upper() == 'TRUE':
self.source_driftcomp = True
else:
self.source_driftcomp = False

# Output configuration
self.output_zmq_host = self.ConfigSectionMap('output')['zmq_host']
Expand Down
4 changes: 4 additions & 0 deletions encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ def run_encoder(self):
args += ' -D'
if self.config.source_type == 'stream':
args += ' --vlc-uri=%s' % (self.config.source_url)
logger.warn('%s' % args)
if self.config.source_driftcomp == True:
args += ' -D'
logger.warn('%s' % args)

args += ' -b %s -r %s' % (self.config.output_bitrate, self.config.output_samplerate)
if self.config.output_sbr == True:
Expand Down
15 changes: 8 additions & 7 deletions static/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ <h4 class="panel-title">
<option value="stream">stream</option>
</select>
</div>
<label class="control-label col-sm-2" for="source_driftcomp">Drift compensation:</label>
<div class="col-sm-3">
<select type="select" class="form-control" id="source_driftcomp">
<option value="true">true</option>
<option value="false">false</option>
</select>
</div>
</div>
<hr />

Expand All @@ -112,13 +119,7 @@ <h4>Source alsa</h4>
<div class="col-sm-3">
<input type="text" class="form-control" id="source_device" placeholder="Enter audio device (ex: hw:1,0)">
</div>
<label class="control-label col-sm-2" for="source_driftcomp">Drift compensation:</label>
<div class="col-sm-3">
<select type="select" class="form-control" id="source_driftcomp">
<option value="true">true</option>
<option value="false">false</option>
</select>
</div>

</div>
<hr />

Expand Down

0 comments on commit ef5be73

Please sign in to comment.