[FFmpeg-devel] [PATCH] DCX demuxer

Michael Niedermayer michaelni at gmx.at
Thu Oct 18 20:17:19 CEST 2012


On Thu, Oct 18, 2012 at 09:24:11AM +0000, Paul B Mahol wrote:
> On 10/18/12, Michael Niedermayer <michaelni at gmx.at> wrote:
> > On Thu, Oct 11, 2012 at 01:14:07PM +0000, Paul B Mahol wrote:
> >> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> >> ---
> >
> >> Last frame never appears when using pipes.
> > [...]
> >> +static int dcx_read_packet(AVFormatContext *s, AVPacket *pkt)
> >> +{
> >> +    DCXDemuxContext *dc = s->priv_data;
> >> +    int size, ret;
> >> +
> >> +    if (dc->current_frame >= s->streams[0]->nb_frames)
> >> +        return AVERROR_EOF;
> >> +    size = dc->frame_offsets[dc->current_frame + 1] -
> >> +           dc->frame_offsets[dc->current_frame];
> >> +    if (size < 0)
> >> +        size = INT_MAX;
> >> +
> >> +    ret = av_get_packet(s->pb, pkt, size);
> >
> > dont try to read INT_MAX sized packets
> >
> > otherwise LGTM
> 
> So it is ok if last frame will be lost in case input is not seekable?
> Should I just abort or what?

you could use a loop that reallocs and reads until EOF,
instead of allocating 2gb

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

What does censorship reveal? It reveals fear. -- Julian Assange
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121018/1dd3e782/attachment.asc>


More information about the ffmpeg-devel mailing list