summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/buffering.c9
-rw-r--r--apps/buffering.h3
-rw-r--r--apps/codec_thread.c8
-rw-r--r--apps/playback.c13
4 files changed, 0 insertions, 33 deletions
diff --git a/apps/buffering.c b/apps/buffering.c
index 1826fa1b91..96ec92201f 100644
--- a/apps/buffering.c
+++ b/apps/buffering.c
@@ -1572,15 +1572,6 @@ size_t buf_get_watermark(void)
1572 return BUF_WATERMARK; 1572 return BUF_WATERMARK;
1573} 1573}
1574 1574
1575#ifdef HAVE_IO_PRIORITY
1576void buf_back_off_storage(bool back_off)
1577{
1578 int priority = back_off ?
1579 IO_PRIORITY_BACKGROUND : IO_PRIORITY_IMMEDIATE;
1580 thread_set_io_priority(buffering_thread_id, priority);
1581}
1582#endif
1583
1584/** -- buffer thread helpers -- **/ 1575/** -- buffer thread helpers -- **/
1585static void shrink_buffer_inner(struct memory_handle *h) 1576static void shrink_buffer_inner(struct memory_handle *h)
1586{ 1577{
diff --git a/apps/buffering.h b/apps/buffering.h
index 218f77ed85..5a1369a31d 100644
--- a/apps/buffering.h
+++ b/apps/buffering.h
@@ -111,9 +111,6 @@ size_t buf_length(void);
111size_t buf_used(void); 111size_t buf_used(void);
112bool buf_pin_handle(int handle_id, bool pin); 112bool buf_pin_handle(int handle_id, bool pin);
113bool buf_signal_handle(int handle_id, bool signal); 113bool buf_signal_handle(int handle_id, bool signal);
114#ifdef HAVE_IO_PRIORITY
115void buf_back_off_storage(bool back_off);
116#endif
117 114
118/* Settings */ 115/* Settings */
119void buf_set_watermark(size_t bytes); 116void buf_set_watermark(size_t bytes);
diff --git a/apps/codec_thread.c b/apps/codec_thread.c
index f2039d10e6..a1fa96d021 100644
--- a/apps/codec_thread.c
+++ b/apps/codec_thread.c
@@ -470,15 +470,7 @@ static void load_codec(const struct codec_load_info *ev_data)
470 /* Either not a valid handle or the buffer method failed */ 470 /* Either not a valid handle or the buffer method failed */
471 const char *codec_fn = get_codec_filename(data.afmt); 471 const char *codec_fn = get_codec_filename(data.afmt);
472 if (codec_fn) 472 if (codec_fn)
473 {
474#ifdef HAVE_IO_PRIORITY
475 buf_back_off_storage(true);
476#endif
477 status = codec_load_file(codec_fn, &ci); 473 status = codec_load_file(codec_fn, &ci);
478#ifdef HAVE_IO_PRIORITY
479 buf_back_off_storage(false);
480#endif
481 }
482 } 474 }
483 475
484 /* Types must agree */ 476 /* Types must agree */
diff --git a/apps/playback.c b/apps/playback.c
index efc23306a0..5c2fc7f8ce 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -1560,9 +1560,6 @@ static bool audio_load_cuesheet(struct track_info *info,
1560 int hid = ERR_UNSUPPORTED_TYPE; 1560 int hid = ERR_UNSUPPORTED_TYPE;
1561 struct cuesheet_file cue_file; 1561 struct cuesheet_file cue_file;
1562 1562
1563#ifdef HAVE_IO_PRIORITY
1564 buf_back_off_storage(true);
1565#endif
1566 if (look_for_cuesheet_file(track_id3, &cue_file)) 1563 if (look_for_cuesheet_file(track_id3, &cue_file))
1567 { 1564 {
1568 hid = bufalloc(NULL, sizeof (struct cuesheet), TYPE_CUESHEET); 1565 hid = bufalloc(NULL, sizeof (struct cuesheet), TYPE_CUESHEET);
@@ -1586,9 +1583,6 @@ static bool audio_load_cuesheet(struct track_info *info,
1586 } 1583 }
1587 } 1584 }
1588 1585
1589#ifdef HAVE_IO_PRIORITY
1590 buf_back_off_storage(false);
1591#endif
1592 if (hid == ERR_BUFFER_FULL) 1586 if (hid == ERR_BUFFER_FULL)
1593 { 1587 {
1594 logf("buffer is full for now (%s)", __func__); 1588 logf("buffer is full for now (%s)", __func__);
@@ -1627,10 +1621,6 @@ static bool audio_load_albumart(struct track_info *info,
1627 memset(&user_data, 0, sizeof(user_data)); 1621 memset(&user_data, 0, sizeof(user_data));
1628 user_data.dim = &albumart_slots[i].dim; 1622 user_data.dim = &albumart_slots[i].dim;
1629 1623
1630#ifdef HAVE_IO_PRIORITY
1631 buf_back_off_storage(true);
1632#endif
1633
1634 /* We can only decode jpeg for embedded AA */ 1624 /* We can only decode jpeg for embedded AA */
1635 if (track_id3->has_embedded_albumart && track_id3->albumart.type == AA_TYPE_JPG) 1625 if (track_id3->has_embedded_albumart && track_id3->albumart.type == AA_TYPE_JPG)
1636 { 1626 {
@@ -1651,9 +1641,6 @@ static bool audio_load_albumart(struct track_info *info,
1651 } 1641 }
1652 } 1642 }
1653 1643
1654#ifdef HAVE_IO_PRIORITY
1655 buf_back_off_storage(false);
1656#endif
1657 if (hid == ERR_BUFFER_FULL) 1644 if (hid == ERR_BUFFER_FULL)
1658 { 1645 {
1659 logf("buffer is full for now (%s)", __func__); 1646 logf("buffer is full for now (%s)", __func__);