Skip to content

Commit

Permalink
Clear the codec_tag when creating a stream from a template
Browse files Browse the repository at this point in the history
This is generally expected when re-muxing
  • Loading branch information
mikeboers committed Jun 9, 2016
1 parent c22a5ee commit 825809c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions av/container/output.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ cdef class OutputContainer(Container):
# Copy from the template.
if template is not None:
lib.avcodec_copy_context(codec_context, template._codec_context)
# Reset the codec tag assuming we are remuxing.
codec_context.codec_tag = 0
# Copy flags assuming we are remuxing.s
if self.proxy.ptr.oformat.flags & lib.AVFMT_GLOBALHEADER:
codec_context.flags |= lib.CODEC_FLAG_GLOBAL_HEADER

# Now lets set some more sane video defaults
elif codec.type == lib.AVMEDIA_TYPE_VIDEO:
Expand Down
2 changes: 2 additions & 0 deletions include/libavcodec/avcodec.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ cdef extern from "libavcodec/avcodec.pyav.h" nogil:

AVMediaType codec_type
char codec_name[32]
unsigned int codec_tag
AVCodecID codec_id

int flags
int thread_count

Expand Down

0 comments on commit 825809c

Please sign in to comment.