[FFmpeg-devel] trac issue #251 and AVFMT_RAWPICTURE

Michael Niedermayer michaelni at gmx.at
Tue May 31 16:06:52 CEST 2011


On Tue, May 31, 2011 at 10:07:19AM +0200, Stefano Sabatini wrote:
> On date Monday 2011-05-30 21:31:46 +0200, Michael Niedermayer encoded:
> > On Mon, May 30, 2011 at 05:14:35PM +0200, Stefano Sabatini wrote:
> > > On date Monday 2011-05-30 14:45:49 +0200, Michael Niedermayer encoded:
> [...]
> > > From: Stefano Sabatini <stefano.sabatini-lala at poste.it>
> > > Date: Mon, 30 May 2011 16:52:35 +0200
> > > Subject: [PATCH] ffmpeg: handle copy of packets for AVFMT_RAWPICTURE output formats
> > > 
> > > Implement the required AVPicture -> AVPacket conversion required by
> > > AVFMT_RAWPICTURE formats.
> > > 
> > > Fix trac issue #251.
> > > ---
> > >  ffmpeg.c |    8 ++++++++
> > >  1 files changed, 8 insertions(+), 0 deletions(-)
> > > 
> > > diff --git a/ffmpeg.c b/ffmpeg.c
> > > index 220feb2..4980620 100644
> > > --- a/ffmpeg.c
> > > +++ b/ffmpeg.c
> > > @@ -1784,6 +1784,14 @@ static int output_packet(AVInputStream *ist, int ist_index,
> > >                              opkt.size = data_size;
> > >                          }
> > >  
> > > +                        if (os->oformat->flags & AVFMT_RAWPICTURE) {
> > > +                            /* convert rawvideo picture to packet, as expected by the output format */
> > > +                            AVPicture pict;
> > > +                            avpicture_fill(&pict, opkt.data, ost->st->codec->pix_fmt, ost->st->codec->width, ost->st->codec->height);
> > > +                            opkt.data = (uint8_t *)&pict;
> > > +                            opkt.size = sizeof(AVPicture);
> > > +                            opkt.flags |= AV_PKT_FLAG_KEY;
> > > +                        }
> > >                          write_frame(os, &opkt, ost->st->codec, ost->bitstream_filters);
> > 
> > This looks like you pass a pointer to a stack variable after its
> > block in which it lives.
> 
> Updated.
> -- 
> FFmpeg = Fancy & Fanciful MultiPurpose Erotic Gigant

>  ffmpeg.c |    8 ++++++++
>  1 file changed, 8 insertions(+)
> f035a391307f3c1a895ed529fb6c8fddbedc6432  0001-ffmpeg-handle-copy-of-packets-for-AVFMT_RAWPICTURE-o.patch
> From be5da55fe1389655e992c673ce4b4cb1ffd58f84 Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefano.sabatini-lala at poste.it>
> Date: Mon, 30 May 2011 16:52:35 +0200
> Subject: [PATCH] ffmpeg: handle copy of packets for AVFMT_RAWPICTURE output formats
> 
> Implement the required AVPicture -> AVPacket conversion required by
> AVFMT_RAWPICTURE formats.
> 
> Fix trac issue #251.

LGTM

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein
-------------- 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/20110531/5234cccf/attachment.asc>


More information about the ffmpeg-devel mailing list