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

Stefano Sabatini stefasab at gmail.com
Mon Aug 6 15:02:08 CEST 2012


On date Sunday 2012-08-05 01:09:17 +0200, Michael Niedermayer encoded:
> 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

Updated.
-- 
FFmpeg = Fabulous and Fierce Mean Portable Earthshaking Geisha
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-examples-muxing-set-codec-in-the-codec-context.patch
Type: text/x-diff
Size: 4728 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120806/70db8299/attachment.bin>


More information about the ffmpeg-devel mailing list