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

Michael Niedermayer michaelni at gmx.at
Mon Aug 6 17:19:00 CEST 2012


On Mon, Aug 06, 2012 at 03:02:08PM +0200, Stefano Sabatini wrote:
> 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

>  muxing.c |   39 ++++++++++++++++++++-------------------
>  1 file changed, 20 insertions(+), 19 deletions(-)
> 8fa8d6c77fbd38ea80416817f3c6e79599aeed95  0001-examples-muxing-set-codec-in-the-codec-context.patch
> From f46555e8287051a3d5a67c76310c5d5bce6eb49c Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefasab at gmail.com>
> Date: Fri, 3 Aug 2012 17:57:45 +0200
> Subject: [PATCH] examples/muxing: set codec in the codec context
> 
> Make add_{audio,video}_stream return the found codec, and pass it to
> avcodec_open2() through open_{audio,video} functions.
> 
> Fix failure:
> No codec provided to avcodec_open2().
> could not open codec
> 
> This is also consistent with the use of the avcodec_open2() API in the
> codebase.

LGTM, thanks

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

You can kill me, but you cannot change the truth.
-------------- 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/20120806/753bee2c/attachment.asc>


More information about the ffmpeg-devel mailing list