MT#61822 use auto lock

Change-Id: Ice8a889f238f545dbd649e38e4f2833862ddaf00
pull/1897/head
Richard Fuchs 11 months ago
parent 03b16d4ba7
commit f0160d1c9d

@ -678,18 +678,15 @@ static bool media_player_cache_get_entry(struct media_player *mp,
lookup.index = mp->cache_index;
lookup.dst_pt = *dst_pt;
mutex_lock(&media_player_cache_lock);
LOCK(&media_player_cache_lock);
struct media_player_cache_entry *entry = mp->cache_entry
= t_hash_table_lookup(media_player_cache, &lookup);
bool ret = true; // entry exists, use cached data
if (entry) {
media_player_cached_reader_start(mp, codec_set);
goto out;
return true;
}
ret = false; // new entry, open decoder, then call media_player_play_start
// initialise object
call_memory_arena_release();
@ -732,12 +729,9 @@ static bool media_player_cache_get_entry(struct media_player *mp,
ilog(LOG_DEBUG, "Using kernel packet stream index %i", entry->kernel_idx);
}
out:
mutex_unlock(&media_player_cache_lock);
call_memory_arena_set(mp->call);
return ret;
return false;
}
static void media_player_cache_packet(struct media_player_cache_entry *entry, char *buf, size_t len,

Loading…
Cancel
Save