[asterisk-commits] rizzo: branch rizzo/video_console r125798 - /team/rizzo/video_console/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 27 09:11:19 CDT 2008


Author: rizzo
Date: Fri Jun 27 09:11:18 2008
New Revision: 125798

URL: http://svn.digium.com/view/asterisk?view=rev&rev=125798
Log:
more debugging for memory leaks (soon to go away).

It appears that frames on chan->readq are not freed
properly if there is no receiver on the remote side.

Because video console still tries to encode and enqueue
frames even when a connection is not active, the queue is
drained and apparently ast_frames are thrown away without
freeing.



Modified:
    team/rizzo/video_console/channels/console_video.c

Modified: team/rizzo/video_console/channels/console_video.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/video_console/channels/console_video.c?view=diff&rev=125798&r1=125797&r2=125798
==============================================================================
--- team/rizzo/video_console/channels/console_video.c (original)
+++ team/rizzo/video_console/channels/console_video.c Fri Jun 27 09:11:18 2008
@@ -885,8 +885,6 @@
 		int fd;
 		char *caption = NULL, buf[160];
 		/* determine if video format changed */
-		if (count % 20 == 0)
-			used_mem(__FUNCTION__);
 		if (count++ % 10 == 0) {
 			if (env->out.sendvideo && env->out.devices)
 			    sprintf(buf, "%s %s %dx%d @@ %dfps %dkbps",
@@ -905,6 +903,8 @@
  
 		/* sleep for a while */
 		ast_select(0, NULL, NULL, NULL, &t);
+		if (count % 20 == 0)
+			used_mem(__FUNCTION__);
 
 	    if (env->in) {
 		struct video_dec_desc *v = env->in;
@@ -934,6 +934,14 @@
 		if (env->shutdown)
 			break;
 		f = get_video_frames(env, &p);	/* read and display */
+		if (count %20 == 0) {
+			int nf;
+			struct ast_frame *g = env->owner ? env->owner->readq.first : NULL;
+			for (nf = 0; g; nf++)
+				g = g->frame_list.next;
+			ast_log(LOG_WARNING, "video queue has size %d f %p\n", nf, f);
+			used_mem("after enqueueing");
+		}
 		if (!f)
 			continue;
 		chan = env->owner;




More information about the asterisk-commits mailing list