[FFmpeg-devel] [PATCH] RTSP-MS 15/15: move packet_time_start zero value assignment in asf.c

Ronald S. Bultje rsbultje
Thu Apr 16 16:14:59 CEST 2009


On Wed, Apr 15, 2009 at 11:13 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Wed, Apr 15, 2009 at 09:36:47PM -0400, Ronald S. Bultje wrote:
>> Shit... I hate you. :-).
> good :)

/me looks doubtful

> yes, url_fseek/skip() clears eof but the first get_byte() or whatever
> will notice it has no data and call fill_buffer() that will set eof_reached
> again, so unless you check for eof straight after a url_fskip/seek it should
> give the correct value

Indeed. Which doesn't happen. Yesterday I blindly assumed it'd call
get_byte() etc. somewhere. It doesn't. It gets stuck here (EOF is not
set) in parse_packet():

        if (asf->packet_size_left < FRAME_HEADER_SIZE
            || asf->packet_segments < 1) {
            //asf->packet_size_left <= asf->packet_padsize) {
            int ret = asf->packet_size_left + asf->packet_padsize;
            //printf("PacketLeftSize:%d  Pad:%d Pos:%"PRId64"\n",
asf->packet_size_left, asf->packet_padsize, url_ftell(pb));
            /* fail safe */
            url_fskip(pb, ret);

            asf->packet_pos= url_ftell(pb);
            if (asf->data_object_size != (uint64_t)-1 &&
                (asf->packet_pos - asf->data_object_offset >=
                return AVERROR(EIO); /* Do not exceed the size of the
data object */

Returning EIO, which causes a return of EIO to ffplay. Ffplay then
checks for EOF, isn't there, reruns and we re-enter this loop. We
never read a single byte, we just skip.

I still think we should add some EOF check to url_fskip() or url_fseek()...


More information about the ffmpeg-devel mailing list