PDA

View Full Version : Using AZID.DLL with Delphi - who can help?


LigH
20th December 2001, 20:21
Dear friends,

I'm trying hard to use the AZID.DLL in an own Delphi program. But I get very strange problems, so I hope someone has much experience in both C and Delphi and can give me good hints how to solve them.

As far as I found out, "cdecl" calling mode is required, and the "int" fields in the ac3opts record really are longint wide. Now my problem is the callback function in ac3_readframe: The buffer address is not the same as the address of the allocated buffer, instead it jumps around like crazy but each time seems to request 1 byte. On request I could give you more details - but please announce private help first, I don't want to discuss every detail here.

DSPguru
24th December 2001, 10:46
hi LigH !
azid will read 1 byte after 1 byte until he finds the syncinfo, then it will read 4 bytes (in order to find the frame size), and then it will read the whold frame (hundreds of bytes).

LigH
26th December 2001, 10:03
It read 1 byte at least a hundred times (before I got tired to run my program step by step and let it run from there) - after minutes it was still reading, and all I could do was kill the process. And each time it reads one byte, it reads it to a different address, and this address is not the location of the allocated buffer - that's what I call strange. I guess I forgot one pointer dereferencing; I'll try again and tell you more soon (currently I'm not at home).

DSPguru
27th December 2001, 18:29
it will keep on reading byte after byte unless it finds syncword. (2 bytes total), than it will read the rest of syncinfo (4 more bytes), and then it will read the whole frame into the buffer you supplied.

LigH
28th December 2001, 16:53
He, DSPguru, I'm not stupid - I already got your first message ;)

And I also was true - I just forgot to dereference a pointer (therefore I read from the file not into the buffer, but over the buffer address). Problem found and solved... on to the next one :D

DSPguru
28th December 2001, 17:24
good luck !