Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linux-dvb] Re: mplex and mpegtools 2gb limit
Andy Coates writes:
> > Both times when it reaches the end of the TS file, and looks
> > like it has
> > completed vid and aud, it hangs.. in exactly the same way
> > dvb-mplex hangs
> > with:
> > # dvb-mplex -t MPEG2 -o test.mpg -i TS_STREAM
> > DVB-9-20021127-2059.36+2h10m.ts
> >
> >
> > read(3, "", 1880) = 0
> > read(3, "", 1880) = 0
> > read(3, "", 1880) = 0
> >
> > ... repeats for ever.. Why is it continuing to read from this
> > file.. the
> > return value of 0 indicated EOF surely?
>
> Looking at the code, dvb-mpegtools differs in that it uses save_read()
> instead of read(), but the function has a slight flaw that won't let it
> exit the read() loop:
>
> ssize_t save_read(int fd, void *buf, size_t count)
> {
> ssize_t neof = 1;
> size_t re = 0;
>
> while(neof >= 0 && re < count){
> neof = read(fd, buf+re, count - re);
> if (neof > 0) re += neof;
> }
>
> if (neof < 0 && re == 0) return neof;
> else return re;
> }
>
Or you could just add a else break; to the if statement in the while
loop.
There is a new version of dvb-mpgtools with some other fixes available
since yesterday.
Marcus
--
/--------------------------------------------------------------------\
| Dr. Marcus O.C. Metzler | |
|--------------------------------|-----------------------------------|
| mocm@metzlerbros.de | http://www.metzlerbros.de/ |
\--------------------------------------------------------------------/
--
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.
Home |
Main Index |
Thread Index