[Asterisk-video] Compiling/using app_h324m and libh32m on 64 bit platforms

Bjorn Hijmans | Mobillion Bjorn.Hijmans at mobillion.nl
Fri Dec 7 03:52:37 CST 2007


Hi all,

First of all: Sergio, thanks a lot for all your excellent work!

We found several problems when using libh324m and app_h324m on 64 bits.
Hopefully this helps others trying to compile on 64 bits platforms (and
Sergio: maybe it fixes a bug in your code).


* The most important problem is a possible bug in the app_h324m code:

It seems, in an ast_frame, the framedata is put at the end of the struct
after a gap of AST_FRIENDLY_OFFSET bytes. The position of the pointer is
determined in the following line:

/* Set data */
send->data = (unsigned char*)send + AST_FRIENDLY_OFFSET;

(this is line 153 of app_h324m.c)

If this is used on a 64 bits platform the send->data pointer will point
into the struct. This is because the size of the ast_frame struct itself
is not taken into account when calculating the pointer. So, we think it
should be:

/* Set data */
send->data = (unsigned char*)send + sizeof(struct ast_frame) +
AST_FRIENDLY_OFFSET;

We are not C guru's so we could be wrong but after this change recording
video (mp4_save) works fine. Before the change, the ast_frame got
corrupted after setting variables in the timeval struct:

send->delivery.tv_usec = 0;
send->delivery.tv_sec = 0;


* In libh324m in several files the size of the pointer should change
from unsigned int to unsigned long. The files are H245MasterSlave.cpp
(line 29), H324MAL2.cpp (line 79), H324MSession.cpp (line 64) and
FileLogger.cpp (line 46 and line 105).


Let me know if you need more info!

Thanks,
Bjorn Hijmans
Mobillion
http://www.mobillion.nl







More information about the asterisk-video mailing list