|
From: <bc...@us...> - 2010-01-29 15:50:48
|
Revision: 1462
http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1462&view=rev
Author: bcholew
Date: 2010-01-29 15:50:24 +0000 (Fri, 29 Jan 2010)
Log Message:
-----------
Iaxclient now refrains from decoding a theora frame from a new video source
(sender) until a keyframe arrives. This avoids visual artifacts from applying
new-source p-frame changes to the final image from the previous source.
Modified Paths:
--------------
trunk/lib/codec_theora.c
Modified: trunk/lib/codec_theora.c
===================================================================
--- trunk/lib/codec_theora.c 2010-01-29 15:29:04 UTC (rev 1461)
+++ trunk/lib/codec_theora.c 2010-01-29 15:50:24 UTC (rev 1462)
@@ -66,6 +66,7 @@
theora_comment tc;
struct deslicer_context *dsc;
int got_key_frame;
+ unsigned short prev_src_id;
};
struct theora_encoder
@@ -143,8 +144,12 @@
op.bytes = flen;
op.packet = (unsigned char *)frame;
- /* reject all incoming frames until we get a key frame */
- if ( !d->got_key_frame )
+ /* Reject all incoming frames until we get a key frame.
+ * Similarly, check for a change in who is sending the video.
+ * We shouldn't use frames from a new source until
+ * we get a keyframe
+ */
+ if ( !d->got_key_frame || d->prev_src_id != d->dsc->source_id )
{
if ( theora_packet_iskeyframe(&op) )
d->got_key_frame = 1;
@@ -179,6 +184,10 @@
return -1;
}
+ // keep track of the source id (from the most
+ // recent valid desliced frame) to detect a switch
+ d->prev_src_id = d->dsc->source_id;
+
//clear output
memset(out, 127, my_out_len);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|