diff options
author | Gilbok Lee <gilbok.lee@samsung.com> | 2022-06-29 11:31:20 +0900 |
---|---|---|
committer | Gilbok Lee <gilbok.lee@samsung.com> | 2022-06-30 01:17:43 +0000 |
commit | 1d1f94b1bcc4a2c371e3ab8744fbb134362efb84 (patch) | |
tree | 02dc5420b8cf0c92c65f68bc8f63214f419ffe28 | |
parent | f75608bd56a96c527c97e7894a48db810ec7c53a (diff) | |
download | libmm-radio-tizen_7.0_hotfix.tar.gz libmm-radio-tizen_7.0_hotfix.tar.bz2 libmm-radio-tizen_7.0_hotfix.zip |
Fix crash on emulatortizen_8.0_m2_releasetizen_7.0_m2_releasesubmit/tizen/20220701.012657accepted/tizen/unified/20220701.150040accepted/tizen/8.0/unified/20231005.093453accepted/tizen/7.0/unified/hotfix/20221116.105427accepted/tizen/7.0/unified/20221110.055802tizen_7.0_hotfixaccepted/tizen_8.0_unifiedaccepted/tizen_7.0_unified_hotfixaccepted/tizen_7.0_unified
- When radio destroy during scanning, the radio pipeline can be freed
[Version] 0.2.50
[Issue Type] Fix bugs
Change-Id: I39f46053696406ec4eea3938ef254d1d76652c7a
(cherry picked from commit ecd17ebb44d857e2e4375512d3bc376b00c7535b)
-rw-r--r-- | packaging/libmm-radio.spec | 2 | ||||
-rw-r--r-- | src/mm_radio_priv_emulator.c | 21 |
2 files changed, 15 insertions, 8 deletions
diff --git a/packaging/libmm-radio.spec b/packaging/libmm-radio.spec index de31e23..980b195 100644 --- a/packaging/libmm-radio.spec +++ b/packaging/libmm-radio.spec @@ -1,6 +1,6 @@ Name: libmm-radio Summary: Multimedia Framework Radio Library -Version: 0.2.49 +Version: 0.2.50 Release: 0 Group: System/Libraries License: Apache-2.0 diff --git a/src/mm_radio_priv_emulator.c b/src/mm_radio_priv_emulator.c index 62dc09b..d7f6cd1 100644 --- a/src/mm_radio_priv_emulator.c +++ b/src/mm_radio_priv_emulator.c @@ -326,8 +326,15 @@ int _mmradio_unrealize(mm_radio_t * radio) MMRADIO_CHECK_INSTANCE(radio); MMRADIO_CHECK_STATE_RETURN_IF_FAIL(radio, MMRADIO_COMMAND_UNREALIZE); - /* if( _mmradio_mute(radio) != MM_ERROR_NONE) */ - /* return MM_ERROR_RADIO_NOT_INITIALIZED; */ + /*Finish if there are scans*/ + ret = _mmradio_stop_scan(radio); + if (ret != MM_ERROR_NONE) + MMRADIO_LOG_WARNING("failed to stop radio scan"); + + /*Stop radio if started*/ + ret = _mmradio_stop(radio); + if (ret != MM_ERROR_NONE) + MMRADIO_LOG_WARNING("failed to stop radio"); /* close radio device here !!!! */ if (radio->radio_fd >= 0) @@ -356,6 +363,7 @@ int _mmradio_destroy(mm_radio_t * radio) MMRADIO_CHECK_STATE_RETURN_IF_FAIL(radio, MMRADIO_COMMAND_DESTROY); _mmradio_unrealize(radio); + /* destroy mutex and thread */ __mmradio_destroy_threads(radio); @@ -376,6 +384,8 @@ int _mmradio_destroy(mm_radio_t * radio) /* unit should be KHz */ int _mmradio_set_frequency(mm_radio_t * radio, int freq) { + + int val = 0; MMRADIO_LOG_FENTER(); MMRADIO_CHECK_INSTANCE(radio); @@ -396,12 +406,10 @@ int _mmradio_set_frequency(mm_radio_t * radio, int freq) } radio->freq = freq; + val = __mmradio_get_wave_num(radio); - if (radio->pipeline) { - int val = 0; - val = __mmradio_get_wave_num(radio); + if (radio->pipeline && radio->pipeline->audiosrc) g_object_set(radio->pipeline->audiosrc, "wave", val, NULL); - } MMRADIO_LOG_FLEAVE(); @@ -663,7 +671,6 @@ int _mmradio_realize_pipeline(mm_radio_t * radio) radio->pipeline->audiosrc = gst_element_factory_make("audiotestsrc", "fm audio src"); radio->pipeline->converter = gst_element_factory_make("audioconvert", "audioconvert"); - radio->pipeline->audiosink = gst_element_factory_make("pulsesink", "audio sink"); radio->pipeline->volume = gst_element_factory_make("volume", "audiovolume"); radio->pipeline->audiosink = gst_element_factory_make("pulsesink", "audio sink"); |