Skip to content
This repository has been archived by the owner on Aug 3, 2019. It is now read-only.

Commit

Permalink
Fix "name 'AudioProcess' is not defined"
Browse files Browse the repository at this point in the history
When you choose not to record audio, you get this error when you stop
recording.  Let's fix that.
  • Loading branch information
mgedmin committed May 31, 2019
1 parent e91de9d commit 4023205
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions green-recorder
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def RecordGnome():
if formatchooser.get_active_id() == "webm":
RecorderPipeline = "vp8enc min_quantizer=10 max_quantizer=50 cq_level=13 cpu-used=5 deadline=1000000 threads=%T ! queue ! webmmux"

global AudioProcess
if audioswitch.get_active() == True:
AudioRecording.append("ffmpeg")
AudioRecording.append("-f")
Expand All @@ -193,9 +193,10 @@ def RecordGnome():
AudioRecording.append("/tmp/Green-recorder-tmp.mkv")
AudioRecording.append("-y")

global AudioProcess
AudioProcess = subprocess.Popen(AudioRecording)

else:
AudioProcess = None

if videoswitch.get_active() == True:
try:
areaaxis
Expand Down Expand Up @@ -241,7 +242,8 @@ def stoprecording(_):

try:
GNOMEScreencast.StopScreencast()
AudioProcess.terminate()
if AudioProcess:
AudioProcess.terminate()
except Exception as e:
print(e)

Expand Down

0 comments on commit 4023205

Please sign in to comment.