Skip to content

Commit a4f218f

Browse files
authored
Fix for #1599
This eventually applies the "workaround" automatically
1 parent 637b21a commit a4f218f

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

av/container/input.pyx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ from av.dictionary import Dictionary
1313

1414

1515
cdef close_input(InputContainer self):
16+
self.streams = StreamContainer()
1617
if self.input_was_opened:
1718
with nogil:
1819
# This causes `self.ptr` to be set to NULL.

av/container/output.pyx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ log = logging.getLogger(__name__)
1818

1919

2020
cdef close_output(OutputContainer self):
21+
self.streams = StreamContainer()
2122
if self._started and not self._done:
2223
# We must only ever call av_write_trailer *once*, otherwise we get a
2324
# segmentation fault. Therefore no matter whether it succeeds or not
@@ -245,9 +246,6 @@ cdef class OutputContainer(Container):
245246
return lib.avcodec_get_name(self.format.optr.subtitle_codec)
246247

247248
def close(self):
248-
for stream in self.streams:
249-
del stream
250-
251249
close_output(self)
252250

253251
def mux(self, packets):

0 commit comments

Comments
 (0)