[FFmpeg-devel] [PATCH] examples/muxing: set codec in the codec context

Michael Niedermayer michaelni at gmx.at
Sun Aug 5 01:09:17 CEST 2012


On Fri, Aug 03, 2012 at 06:04:37PM +0200, Stefano Sabatini wrote:
> Avoid failure:
> No codec provided to avcodec_open2().
> could not open codec
> ---
>  doc/examples/muxing.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/doc/examples/muxing.c b/doc/examples/muxing.c
> index 4e62b87..a5d5cf5 100644
> --- a/doc/examples/muxing.c
> +++ b/doc/examples/muxing.c
> @@ -78,6 +78,7 @@ static AVStream *add_audio_stream(AVFormatContext *oc, enum CodecID codec_id)
>      st->id = 1;
>  
>      c = st->codec;
> +    c->codec = codec;

i think passing it as argument to avcodec_open2() is more correct

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

What does censorship reveal? It reveals fear. -- Julian Assange
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120805/1d9b65f9/attachment.asc>


More information about the ffmpeg-devel mailing list