Changeset 3949 for pjproject/trunk


Ignore:
Timestamp:
Feb 3, 2012 7:56:12 AM (13 years ago)
Author:
ming
Message:

Re #1446 (misc fix): Fix crash problem due to uninitialized list when SDL creation failed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia-videodev/sdl_dev.c

    r3914 r3949  
    915915    strm->sf = sf; 
    916916    pj_memcpy(&strm->vid_cb, cb, sizeof(*cb)); 
     917    pj_list_init(&strm->list_entry); 
     918    strm->list_entry.stream = strm; 
    917919    strm->user_data = user_data; 
    918920 
    919921    /* Create render stream here */ 
    920     if (param->dir & PJMEDIA_DIR_RENDER) { 
    921         job_queue_post_job(sf->jq, sdl_create, strm, 0, &status); 
    922         if (status != PJ_SUCCESS) { 
    923             goto on_error; 
    924         } 
    925         pj_list_init(&strm->list_entry); 
    926         strm->list_entry.stream = strm; 
    927         pj_mutex_lock(strm->sf->mutex); 
    928         if (pj_list_empty(&strm->sf->streams)) 
    929             pj_sem_post(strm->sf->sem); 
    930         pj_list_insert_after(&strm->sf->streams, &strm->list_entry); 
    931         pj_mutex_unlock(strm->sf->mutex); 
    932     } 
     922    job_queue_post_job(sf->jq, sdl_create, strm, 0, &status); 
     923    if (status != PJ_SUCCESS) { 
     924        goto on_error; 
     925    } 
     926    pj_mutex_lock(strm->sf->mutex); 
     927    if (pj_list_empty(&strm->sf->streams)) 
     928        pj_sem_post(strm->sf->sem); 
     929    pj_list_insert_after(&strm->sf->streams, &strm->list_entry); 
     930    pj_mutex_unlock(strm->sf->mutex); 
    933931 
    934932    /* Apply the remaining settings */ 
Note: See TracChangeset for help on using the changeset viewer.