[FFmpeg-devel] [RFC] How to fix DR+lavfi+vflip crash

Michael Niedermayer michaelni
Thu Dec 9 04:35:58 CET 2010


On Mon, Dec 06, 2010 at 03:30:28PM +0100, Stefano Sabatini wrote:
> On date Sunday 2010-12-05 12:12:58 +0100, Stefano Sabatini encoded:
> > On date Friday 2010-12-03 00:03:15 +0100, Michael Niedermayer encoded:
> > > On Sat, Nov 27, 2010 at 04:53:51PM +0100, Stefano Sabatini wrote:
> > [...]
> > > isnt it easier to handle (lack) of neg linesize support by using the premission
> > > system?
> > > like "i need a readable buffer" vs. "i need a buffer with positive linesize"
> > 
> > New attempt. Note the addition of a flag in start_frame(), I added a
> > flag since it seemed more flexible.
> 
> Simpler.
[...]
> diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
> index 5d34bee..194a614 100644
> --- a/libavfilter/avfilter.h
> +++ b/libavfilter/avfilter.h
> @@ -86,6 +86,7 @@ typedef struct AVFilterBuffer {
>  #define AV_PERM_PRESERVE 0x04   ///< nobody else can overwrite the buffer
>  #define AV_PERM_REUSE    0x08   ///< can output the buffer multiple times, with the same contents each time
>  #define AV_PERM_REUSE2   0x10   ///< can output the buffer multiple times, modified each time
> +#define AV_PERM_POS_LINESIZES  0x20  ///< the buffer requested cannot have negative linesizes

i think POS is a bad term because it hints to position primarely before positive
or anything else



>  
>  /**
>   * Audio specific properties in a reference to an AVFilterBuffer. Since
> diff --git a/libavfilter/vf_vflip.c b/libavfilter/vf_vflip.c
> index 95d90d3..84c92bd 100644
> --- a/libavfilter/vf_vflip.c
> +++ b/libavfilter/vf_vflip.c

a solution in vflip is not ideal as this would require each filter that
could produce negative linesizes to duplicate that solution.
a fix should be in the filter core, there already is code to copy a frame
when permissions are not compatible and using that should be simpler than your
patch

[...]
--
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Asymptotically faster algorithms should always be preferred if you have
asymptotical amounts of data
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101209/3d389364/attachment.pgp>



More information about the ffmpeg-devel mailing list