Browse Source

MT#61822 hold call reference while decoding

The media blob is owned by the call, so we need to hold a reference to
the call until decoding is finished.

Change-Id: I6ed0d35edb485aad2811b287706ef101c4aa2c3f
pull/1897/head
Richard Fuchs 11 months ago
parent
commit
1191d2e8ca
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      daemon/media_player.c

+ 3
- 0
daemon/media_player.c View File

@ -77,6 +77,7 @@ struct media_player_cache_entry {
struct media_player_coder coder; // de/encoder data
char *info_str; // for logging
call_t *call_ref;
};
struct media_player_cache_packet {
char *buf;
@ -790,6 +791,7 @@ static void media_player_cache_entry_decoder_thread(void *p) {
}
t_hash_table_destroy(entry->wait_queue); // not needed any more
entry->wait_queue = media_player_ht_null();
obj_release(entry->call_ref);
mutex_unlock(&entry->lock);
}
@ -858,6 +860,7 @@ static bool media_player_cache_entry_init(struct media_player *mp, const rtp_pay
ZERO(mp->coder);
mp->coder.duration = entry->coder.duration; // retain this for reporting
entry->coder.avioctx->opaque = &entry->coder; // format context pointer must point to new coder
entry->call_ref = obj_get(mp->call); // hold reference until decoding is finished, as blob is owned by call
entry->coder.handler->packet_encoded = media_player_packet_cache;


Loading…
Cancel
Save