Ignore:
Timestamp:
May 10, 2019 8:27:22 AM (4 years ago)
Author:
ming
Message:

Re #2189: Fixing various bugs:

  • assertion: !Endpoint::instance().mediaExists(*this) in Media::registerMediaPort() when using AudioMedia?

Sound device is already registered in the conference bridge, while AudioMediaPlayer/Recorder? creation function, i.e. pjsua_player_create(), pjsua_playlist_create(), and pjsua_recorder_create() already call pjmedia_conf_add_port(), so mediaExists() will always return TRUE.

  • Endpoint.mediaAdd() should check in its own internal list if the media exists, rather than querying pjsua.
  • Calling Endpoint::libDestroy() first, then deleting Endpoint will cause crash, since the mutex to remove the medias has been deleted in libDestroy().

The introduction of the mutex is in r5964.

  • DevAudioMedia? never removes itself from mediaList, potentially causing infinite loop/crash.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua2/media.cpp

    r5972 r5986  
    132132{ 
    133133    /* Check if media already added to Conf bridge. */ 
    134     pj_assert(!Endpoint::instance().mediaExists(*this)); 
    135  
    136     if (port != NULL) { 
     134    if (!Endpoint::instance().mediaExists(*this) && port != NULL) { 
    137135        pj_assert(id == PJSUA_INVALID_ID); 
    138136 
     
    664662    /* Avoid removing this port (conf port id=0) from conference */ 
    665663    this->id = PJSUA_INVALID_ID; 
     664    unregisterMediaPort(); 
    666665} 
    667666 
Note: See TracChangeset for help on using the changeset viewer.