summaryrefslogtreecommitdiff
path: root/src/audio
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-10-09 07:04:11 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-10-09 07:04:11 +0300
commitbb7bc6fac4fec804846d11c7d77e1b553ba2be6a (patch)
treec170f134b5ac01c29195589cc77ae4598a524eb3 /src/audio
parent5b58cc76bd08d0e061c5f14506d97ee8dc3b7174 (diff)
Fixed memory leak on tab close
The DocumentWidget was not actually deleted when a tab was closed, only hidden.
Diffstat (limited to 'src/audio')
-rw-r--r--src/audio/player.c6
-rw-r--r--src/audio/player.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/src/audio/player.c b/src/audio/player.c
index 5b9d0103..07f41f01 100644
--- a/src/audio/player.c
+++ b/src/audio/player.c
@@ -563,3 +563,9 @@ float streamProgress_Player(const iPlayer *d) {
563 } 563 }
564 return 0; 564 return 0;
565} 565}
566
567iString *metadataLabel_Player(const iPlayer *d) {
568 return newFormat_String("%d-bit %s %d Hz", SDL_AUDIO_BITSIZE(d->decoder->inputFormat),
569 SDL_AUDIO_ISFLOAT(d->decoder->inputFormat) ? "float" : "integer",
570 d->spec.freq);
571}
diff --git a/src/audio/player.h b/src/audio/player.h
index c3552640..fe6717b0 100644
--- a/src/audio/player.h
+++ b/src/audio/player.h
@@ -45,3 +45,5 @@ iBool isPaused_Player (const iPlayer *);
45float time_Player (const iPlayer *); 45float time_Player (const iPlayer *);
46float duration_Player (const iPlayer *); 46float duration_Player (const iPlayer *);
47float streamProgress_Player (const iPlayer *); /* normalized 0...1 */ 47float streamProgress_Player (const iPlayer *); /* normalized 0...1 */
48
49iString * metadataLabel_Player (const iPlayer *);