Ignore:
Timestamp:
Jul 16, 2009 11:37:15 AM (15 years ago)
Author:
bennylp
Message:

More ticket #920: fix latency calculation not able to calculate latency higher than 500ms and added copyright info in source files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/pjsystest/systest.c

    r2835 r2836  
     1/* $Id$ */ 
     2/*  
     3 * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) 
     4 * 
     5 * This program is free software; you can redistribute it and/or modify 
     6 * it under the terms of the GNU General Public License as published by 
     7 * the Free Software Foundation; either version 2 of the License, or 
     8 * (at your option) any later version. 
     9 * 
     10 * This program is distributed in the hope that it will be useful, 
     11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     13 * GNU General Public License for more details. 
     14 * 
     15 * You should have received a copy of the GNU General Public License 
     16 * along with this program; if not, write to the Free Software 
     17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  
     18 */ 
    119#include "systest.h" 
    220#include "gui.h" 
     
    678696 
    679697        /* Advance next loop */ 
    680         start_pos += wav->info.clock_rate; 
     698        if (start_pos == 0) { 
     699            start_pos = max_signal_pos + wav->info.clock_rate * 9 / 10; 
     700        } else { 
     701            start_pos += wav->info.clock_rate; 
     702        } 
    681703    } 
    682704 
     
    743765    /* Setup the test */ 
    744766    //status = pjsua_conf_connect(0, 0); 
     767    status = pjsua_conf_connect(play_slot, 0); 
    745768    status = pjsua_conf_connect(0, rec_slot); 
    746     status = pjsua_conf_connect(play_slot, 0); 
    747769    status = pjsua_conf_connect(play_slot, rec_slot); 
    748770     
     
    754776    //status = pjsua_conf_disconnect(0, 0); 
    755777    status = pjsua_conf_disconnect(play_slot, rec_slot); 
     778    status = pjsua_conf_disconnect(0, rec_slot); 
    756779    status = pjsua_conf_disconnect(play_slot, 0); 
    757     status = pjsua_conf_disconnect(0, rec_slot); 
    758780 
    759781    pjsua_recorder_destroy(rec_id); 
     
    774796        goto on_return; 
    775797 
    776     status = pjsua_conf_connect(pjsua_player_get_conf_port(play_id), 0); 
     798    play_slot = pjsua_player_get_conf_port(play_id); 
     799 
     800    status = pjsua_conf_connect(play_slot, 0); 
    777801    if (status != PJ_SUCCESS) 
    778802        goto on_return; 
     
    782806                     "Can you hear the 'tock' echo?", 
    783807                     WITH_YESNO); 
     808 
     809    pjsua_player_destroy(play_id); 
     810    play_id = PJSUA_INVALID_ID; 
     811 
    784812    if (key != KEY_YES) 
    785813        goto on_return; 
Note: See TracChangeset for help on using the changeset viewer.