[Asterisk-video] mp4save coredump if no packets video during the recording

tech at i6net.com tech at i6net.com
Fri Jan 25 09:25:17 CST 2008


Last nigth I have working in a coredump generated in Thomas's server.

I think I have found the cause.

<<
I have check all your traces, and I have found a problem from the h324m
stack or the video phone :
"No packet is receive after the recording start...".

If no packet is received, the record application have a bug, let me
explain :

- In  the function mp4_save, the structure videoTrack is initalized when
a video packet is receive.
So in your cases, no packet is received.

- After the record (interrupted by an hangup I suppose). The mp4_save
fonction have a end processing with this lines :
    /* Save last video frame if needed */
    if (videoTrack.sampleId > 0)
        /* Save frame */
        mp4_rtp_write_video_frame(&videoTrack, 0);
But the stucture is no initialized (contains hazardous values) and the
mp4 stream datas are not created too.
Then the "if" succeeds and the the record function calls the
mp4_rtp_write_video_frame function with wrong datas.

I have made a modification (I set the videoTrack.sampleId to 0 at the
beginning of the record function).

static int mp4_save(struct ast_channel *chan, void *data)
{
	struct ast_module_user *u;
	struct ast_frame *f;
	struct mp4track audioTrack;
	struct mp4track videoTrack;
	MP4FileHandle mp4;
	MP4TrackId audio = -1;
	MP4TrackId video = -1;
	MP4TrackId hintAudio = -1;
	MP4TrackId hintVideo = -1;
	unsigned char type = 0;
	char *params = NULL;
	int audio_payload, video_payload;
	int loopVideo = 0;
	int waitVideo = 0;

	/* If no video packet received */
	videoTrack.sampleId = 0;

	/* Check for file */
	if (!data)
		return -1;

>>

I have made the correction to Thomas.
He's testing it.

Best regards,


Tech



More information about the asterisk-video mailing list