From dc5e35f31c39291f36182a0c2456f4d69ef87651 Mon Sep 17 00:00:00 2001 From: WyattBlue Date: Sun, 2 Feb 2025 12:18:59 -0500 Subject: [PATCH] Remove unused code for passing in a Codec object --- av/container/output.pyx | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/av/container/output.pyx b/av/container/output.pyx index e61ef2297..c2055486e 100644 --- a/av/container/output.pyx +++ b/av/container/output.pyx @@ -51,23 +51,15 @@ cdef class OutputContainer(Container): Supports video, audio, and subtitle streams. :param codec_name: The name of a codec. - :type codec_name: str | Codec + :type codec_name: str :param dict options: Stream options. :param \\**kwargs: Set attributes for the stream. :rtype: The new :class:`~av.stream.Stream`. """ - cdef const lib.AVCodec *codec - cdef Codec codec_obj - - if isinstance(codec_name, Codec): - if codec_name.mode != "w": - raise ValueError("codec_name must be an encoder.") - codec_obj = codec_name - else: - codec_obj = Codec(codec_name, "w") - codec = codec_obj.ptr + cdef Codec codec_obj = Codec(codec_name, "w") + cdef const lib.AVCodec *codec = codec_obj.ptr # Assert that this format supports the requested codec. if not lib.avformat_query_codec(self.ptr.oformat, codec.id, lib.FF_COMPLIANCE_NORMAL):