[Libburn] Patch to enable arbitrary input fd (updated 2nd submission)

Derek Foreman manmower at signalmarketing.com
Fri Feb 10 19:15:17 PST 2006

sizeof(off_t) on a 32 bit machine is 32 bits...

I'm thinking maybe we should consider C99 instead of C90, which gives us 
int64_t in stdint.h. (I've added that #include)

sector.c needed a change for when a track depletes and we want to pull 
from the next (probably only a concern with audio CDs), I've done that in 

I've fixed sector.c, and I've merged a small portion of your patch, and 
hopefully made the BE_CANCEL change unimportant.

What I merged was your new blocking file_read.

Can you change the rest to use off_t?

Also, I don't want a change to structure.c for this...  Instead of the 
burn_source_get_size() wrapper, can you just write your own get_size 
function instead of using file_size in burn_fd_source_new()?

The fixed_size data shouldn't be a new member of the burn_source struct, 
rather you use the source specific data pointer (*data) that's already in 
burn_source.  (and also add the appropriate function to free it)

The only change we should need in libburn.h would be your
+struct burn_source *burn_fd_source_new(int fd, int64_t size);

Does that make sense?

On Fri, 10 Feb 2006, Thomas Schmitt wrote:

> Hi,
> find attached my patch for arbitray input file descriptors.
> It is tested with a corrected BE_CANCELED value and test/burniso.c
> for both, input from a disk file and input from stdin.
> ----------------------------------------------------------------
> I have to apologize for including <sys/types.h> in libburn.h
> but off_t is the right type for file sizes and it seems to
> need <sys/types.h> although the man pages say rather <stdio.h>.
> Internally, libburn is not prepared for >2 GB but
> with the off_t interface members it can be enhanced
> without a further API change.
> Derek, i would not object imuch if you canceled off_t and
> replaced it by int.
> (I myself would have used type double. It is exact enough even
> with petabytes and it does not need special includes. Shrug.)
> Whatever, you will have to look into  file_size()
> which now adds an off_t to an int. This can have quite
> confusing consequences (even negative values) if by
> mistake a disk file with a full size DVD image is processed.
> off_t offers a cheap way out of eventual 32 bit rollovers and
> towards future DVD adventures.
> ----------------------------------------------------------------
> The other implementation details are as discussed in
> the last weeks.
> I made some changes to test/burniso.c in order to allow
> stdin as input.
> Have a nice day :)
> Thomas
> -- 
> DSL-Aktion wegen großer Nachfrage bis 28.2.2006 verlängert:
> GMX DSL-Flatrate 1 Jahr kostenlos* http://www.gmx.net/de/go/dsl

More information about the libburn mailing list