[FFmpeg-devel] [PATCH] RTSP-MS 14/15: ASF packet parsing

Ronald S. Bultje rsbultje
Wed Apr 22 13:39:07 CEST 2009


Hi Luca,

On Wed, Apr 22, 2009 at 3:21 AM, Luca Abeni <lucabe72 at email.it> wrote:
> Regarding the payload buffer, the patch looks better than the last one,
> but the code still looks quite convoluted:
> + ? ? ? ?if (!(mflags & 0x40)) {
> + ? ? ? ? ? ?if (!len_off && !asf->pktbuf) {
> + ? ? ? ? ? ? ? ?if (!(res = url_open_dyn_buf(&asf->pktbuf)))
> + ? ? ? ? ? ? ? ? ? ?return res;
> + ? ? ? ? ? ?} else if (len_off != url_ftell(asf->pktbuf)) {
> + ? ? ? ? ? ? ? ?uint8_t *p;
> + ? ? ? ? ? ? ? ?url_close_dyn_buf(asf->pktbuf, &p);
> [...]
> + ? ? ? ?} else {
> + ? ? ? ? ? ?asf->buf = av_malloc(len - off);
> + ? ? ? ? ? ?asf->pos = len - off;
> + ? ? ? ? ? ?memcpy(asf->buf, buf + off, len - off);
> + ? ? ? ?}
>
> Unless microsoft is using standard headers and flags in a very
> non-standard way, I think this code can be written in a much
> simpler way.

I'll try to simpify. For the original version, do you "mind" if I just
don't care about missing buffers etc. and discard everything that is
not exactly in sync? I understand that eventually the idea is that
out-of-order packets and missing packets are all handled, but is it OK
if we don't in this first version?

Also, generally speaking, how do I "discard" / "reset" a dyn_buf?

Thanks,
Ronald



More information about the ffmpeg-devel mailing list