Skip to content

Commit 906b6dc

Browse files
committed
Fixing SampleDecodeMultiThread
1 parent c966fdf commit 906b6dc

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

SampleDecodeMultiThread.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,8 @@ def __init__(self, gpuID, encFile):
7575
self.num_frame = 0
7676

7777
def run(self):
78-
cvt_ctx = nvc.ColorspaceConverionContext(color_space=self.nvDec.ColorSpace(),
78+
cvt_ctx = nvc.ColorspaceConversionContext(color_space=self.nvDec.ColorSpace(),
7979
color_range=self.nvDec.ColorRange())
80-
fout = open("out.rgb", "wb")
8180
try:
8281
while True:
8382
try:
@@ -108,9 +107,6 @@ def run(self):
108107
if not (success):
109108
print('Failed to download surface')
110109
break
111-
else:
112-
bits = bytearray(self.rawFrame)
113-
fout.write(bits)
114110

115111
self.num_frame += 1
116112
if(0 == self.num_frame % self.nvDec.Framerate()):
@@ -123,13 +119,13 @@ def run(self):
123119
def create_threads(gpu_id1, input_file1, gpu_id2, input_file2):
124120

125121
th1 = Worker(gpu_id1, input_file1)
126-
#th2 = Worker(gpu_id2, input_file1)
122+
th2 = Worker(gpu_id2, input_file1)
127123

128124
th1.start()
129-
#th2.start()
125+
th2.start()
130126

131127
th1.join()
132-
#th2.join()
128+
th2.join()
133129

134130
if __name__ == "__main__":
135131

0 commit comments

Comments
 (0)