Please sign in to comment.
Use preferred avcodec_parameters_to_context
From https://wiki.libav.org/Migration/12 "It used to be common practice to use this embedded AVCodecContext as the actual encoding or decoding context. It also used to be passed to bitstream filters and parsers. This process was extremely ill-defined and unsafe, since all those components may see the stream at different stages (since each component has its own, potentially quite large, delay) and may try to overwrite various AVCodecContext fields in ways that are unexpected for the other components." "To solve those issues, a new AVCodecParameters object is introduced, and its instance is added to AVStream as AVStream.codecpar. The demuxers now export all codec parameters read from the input stream into this new object. Similarly, the caller should set the stream parameters in this object when muxing. For encoding or decoding, the caller should allocate a separate AVCodecContext object. avcodec_parameters_from_context()/avcodec_parameters_to_context() functions are provided to transfer the stream parameters between an AVCodecContext and AVCodecParameters, so that a caller can easily initialise a decoder with demuxer information, or a muxer with encoder information."
- Loading branch information...
Showing with 17 additions and 2 deletions.