[FFmpeg-devel] [PATCH] image2 bugfix for image2pipe

Michael Niedermayer michaelni
Wed May 27 05:11:16 CEST 2009


On Tue, May 26, 2009 at 05:19:17PM +0200, Peter Holik wrote:
> > On 2009-05-26 16:45, Peter Holik wrote:
> >>> On Tue, May 26, 2009 at 03:04:05PM +0200, Peter Holik wrote:
> >>>
> >>>>> cosmetics must be seperate from functional changes, its not
> >>>>> possible to review patches with reasonable effort otherwise
> >>>>>
> >>>> 02-image2-cosmetics-for-image2pipe.patch contains some cosmetics on
> >>>>   img_read_packet -> "if(!s->is_pipe)" check is not needed anymore.
> >>>>
> >>> Still contains cosmetics.
> >>>
> >>
> >> right, but now the patches should be correct seperated in functional changes (01)
> >> and cosmetics ones (02)
> >>
> >> cu Peter
> >
> >
> >> @@ -306,6 +298,37 @@
> >>      }
> >>  }
> >>
> >> +static int img_read_packet_pipe(AVFormatContext *s1, AVPacket *pkt)
> >> +{
> >>
> >> [...]
> >>
> >> +    return 0;
> >> +}
> >> +
> >
> >
> > shouldn't that be under #if CONFIG_IMAGE2PIPE_DEMUXER ?
> >
> >> +    if (url_feof(s1->pb))
> >> +            return AVERROR(EIO);
> >>
> >
> > weird indentation
> 
> corrected
[...]
> +#if CONFIG_IMAGE2PIPE_DEMUXER
> +static int img_read_packet_pipe(AVFormatContext *s1, AVPacket *pkt)
> +{
> +    int size=0, ret;
> +
> +    if (url_feof(s1->pb))
> +        return AVERROR(EIO);
> +
> +    av_new_packet(pkt, 4096);
> +    pkt->stream_index = 0;
> +    pkt->flags |= PKT_FLAG_KEY;
> +
> +    while (!url_feof(s1->pb)) {
> +        ret= get_buffer(s1->pb, &pkt->data[size], 4096);
> +
> +        if (ret>0) {
> +            size += ret;
> +
> +            pkt->data = av_fast_realloc(pkt->data, &pkt->size, size + 4096 + FF_INPUT_BUFFER_PADDING_SIZE);
> +            if(!pkt->data)
> +                return AVERROR(ENOMEM);
> +
> +            av_shrink_packet(pkt, size);
> +        }
> +    }

this is just wrong

I suspect that what you want is a png AVParser

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

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090527/0b3d62dd/attachment.pgp>



More information about the ffmpeg-devel mailing list