Ignore:
Timestamp:
May 10, 2019 8:27:22 AM (5 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/call.cpp

    r5985 r5986  
    861861            /* Clear medias. */ 
    862862            for (mi = 0; mi < medias.size(); mi++) { 
    863                 if (medias[mi]) 
     863                if (medias[mi]) { 
     864                    Endpoint::instance().mediaRemove((AudioMedia&)*medias[mi]); 
    864865                    delete medias[mi]; 
     866                } 
    865867            } 
    866868            medias.clear();      
     
    923925        /* Clear medias. */ 
    924926        for (mi = 0; mi < medias.size(); mi++) { 
    925             if (medias[mi]) 
     927            if (medias[mi]) { 
     928                Endpoint::instance().mediaRemove((AudioMedia &)*medias[mi]); 
    926929                delete medias[mi]; 
     930            } 
    927931        } 
    928932        medias.clear(); 
Note: See TracChangeset for help on using the changeset viewer.