[FFmpeg-devel] trac issue #251 and AVFMT_RAWPICTURE
Stefano Sabatini
stefano.sabatini-lala at poste.it
Mon May 30 17:14:35 CEST 2011
On date Monday 2011-05-30 14:45:49 +0200, Michael Niedermayer encoded:
> On Mon, May 30, 2011 at 01:27:42AM +0200, Stefano Sabatini wrote:
> > Hi,
> >
> > curiously today is the second time I step into the AVFMT_RAWPICTURE
> > flag.
> >
> > yuv4mpeg is currently segfaulting with -vcodec copy, that's because
> > the code which converts AVFrame -> AVPicture in
> > ffmpeg.c:do_video_out() is not executed, and the code in
> > yuv4_write_packet:
> >
> > picture = (AVPicture *)pkt->data;
> > ...
> > ptr = pkt->data[0];
> > ...
> >
> > ptr = picture->data[0]; => set to NULL
> > for(i=0;i<height;i++) {
> > avio_write(pb, ptr, width);
> > ptr += picture->linesize[0];
> > }
> >
> > fails with a crash.
> >
> > AVFMT_RAWPICTURE is currently used only in yuv4mpeg and in nullenc
> > (where it is not even required), so I wonder if it would make sense to
> > simply drop the flag (and simplify the API, which is currently
> > complicated for so small gain).
>
> i dont know
> if AVFMT_RAWPICTURE could be used more widespread and would allow
> avoiding a memcpy() it might be better tio keep it otherwise i guess
> we should drop it
Check if the attached patch looks fine to you (and yes
AVFMT_RAWPICTURE may be useful in other places, e.g. in the SDL output
device, so...).
--
FFmpeg = Fast & Faithful Multimedia Portable Explosive Governor
-------------- 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: 1470 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110530/b77e0439/attachment.bin>
More information about the ffmpeg-devel
mailing list