Skip to content

Commit a961fd4

Browse files
committed
Remove unused code for passing in a Codec object
1 parent 824987b commit a961fd4

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

av/container/output.pyx

+3-11
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,15 @@ cdef class OutputContainer(Container):
5151
Supports video, audio, and subtitle streams.
5252
5353
:param codec_name: The name of a codec.
54-
:type codec_name: str | Codec
54+
:type codec_name: str
5555
:param dict options: Stream options.
5656
:param \\**kwargs: Set attributes for the stream.
5757
:rtype: The new :class:`~av.stream.Stream`.
5858
5959
"""
6060

61-
cdef const lib.AVCodec *codec
62-
cdef Codec codec_obj
63-
64-
if isinstance(codec_name, Codec):
65-
if codec_name.mode != "w":
66-
raise ValueError("codec_name must be an encoder.")
67-
codec_obj = codec_name
68-
else:
69-
codec_obj = Codec(codec_name, "w")
70-
codec = codec_obj.ptr
61+
cdef Codec codec_obj = Codec(codec_name, "w")
62+
cdef const lib.AVCodec *codec = codec_obj.ptr
7163

7264
# Assert that this format supports the requested codec.
7365
if not lib.avformat_query_codec(self.ptr.oformat, codec.id, lib.FF_COMPLIANCE_NORMAL):

0 commit comments

Comments
 (0)