[FFmpeg-devel] [PATCH 1/3] lavu/frame: add av_frame_realign().

Nicolas George george at nsup.org
Sun May 7 17:41:11 EEST 2017

L'octidi 18 floréal, an CCXXV, Marton Balint a écrit :
> I suggest to return 1 if an actual alignment (with deep copy) happened.

Actually, as Muhammad just pointed and as I noticed a few minutes ago,
we can not use the same function from lavfi and lavc, due to the
get_buffer issue.

I propose the attached patch to factor the alignment check (notice it is
slightly more complex than in Muhammad's patch, because it takes care of
all cases and not just the mp3lame crash). The realignment functions
will look like:

int ff_frame_realign(AVFrame *frame, unsigned align)
    if (ff_frame_check_align(frame, align))
	return 0;

    <copy-paste from av_frame_make_writable()>


    <copy-paste from av_frame_make_writable()>

If we were not so much in a rush, I would propose a solution to avoid
the copy-paste, but it can wait for later.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lavu-frame-add-av_frame_check_align.patch
Type: text/x-diff
Size: 1813 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170507/8e8612b7/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170507/8e8612b7/attachment.sig>

More information about the ffmpeg-devel mailing list