[FFmpeg-devel] [PATCH] Add SUP/PGS subtitle demuxer

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Aug 31 11:50:36 CEST 2014


On Sun, Aug 31, 2014 at 11:39:16AM +0200, wm4 wrote:
> I got the semantics of avio_read wrong: short reads on EOF are in
> fact allowed and don't return an error. Hopefully this is correct now...

What I _really_ dislike about these approaches is that we hard-code EOF
behaviour in every single demuxer.
So some will return partial packets some won't.
And if we wanted to make that behaviour configurable we'd have to add
options to every single one instead of changing the code in one single
place.
Not to mention all the other optimizations, just look how much e.g.
av_get_packet actually does!
Why do you absolutely want to handle this manually via avio_read?
You can just use av_get_packet + av_append_packet, then you only need
to check the size once, and you also don't have to set "pkt->pos"
manually and you still don't have to do seekback.


More information about the ffmpeg-devel mailing list