[FFmpeg-devel] trac issue #251 and AVFMT_RAWPICTURE
Stefano Sabatini
stefano.sabatini-lala at poste.it
Tue May 31 10:07:19 CEST 2011
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ffmpeg-handle-copy-of-packets-for-AVFMT_RAWPICTURE-o.patch
Type: text/x-diff
Size: 1827 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110531/11321b64/attachment.bin>
More information about the ffmpeg-devel
mailing list