Index: channels/chan_iax2.c =================================================================== --- channels/chan_iax2.c (revision 102329) +++ channels/chan_iax2.c (working copy) @@ -480,6 +480,8 @@ unsigned int last; /*! Last sent timestamp - never send the same timestamp twice in a single call */ unsigned int lastsent; + /*! Timestamp of the last video frame sent */ + unsigned int lastvsent; /*! Next outgoing timestamp if everything is good */ unsigned int nextpred; /*! True if the last voice we transmitted was not silence/CNG */ @@ -3784,7 +3786,7 @@ p->nextpred = ms; p->notsilenttx = 1; } - } else { + } else if ( f->frametype != AST_FRAME_VIDEO ) { /* On a dataframe, use last value + 3 (to accomodate jitter buffer shrinking) if appropriate unless it's a genuine frame */ if (genuine) { @@ -4153,11 +4155,22 @@ /* Mark that mini-style frame is appropriate */ sendmini = 1; } - if (((fts & 0xFFFF8000L) == (lastsent & 0xFFFF8000L)) && - (f->frametype == AST_FRAME_VIDEO) && - ((f->subclass & ~0x1) == pvt->svideoformat)) { + if ( f->frametype == AST_FRAME_VIDEO ) { + /* + * If the lower 15 bits of the timestamp roll over, or if + * the video format changed then send a full frame. + * Otherwise send a mini video frame + */ + if (((fts & 0xFFFF8000L) == (pvt->lastvsent & 0xFFFF8000L)) && + ((f->subclass & ~0x1) == pvt->svideoformat) + ) { now = 1; sendmini = 1; + } else { + now = 0; + sendmini = 0; + } + pvt->lastvsent = fts; } /* Allocate an iax_frame */ if (now) {