diff options
author | Joe <bousset.rudy@gmail.com> | 2022-07-03 03:53:54 +0200 |
---|---|---|
committer | Joe <bousset.rudy@gmail.com> | 2022-07-03 03:53:54 +0200 |
commit | 0b6b0c1ca1095e77fcceccd451ac1f684ed46003 (patch) | |
tree | 0c454ce588a0d0da8b2c1853adc0c9a7fda869af | |
parent | WIP (diff) | |
download | mpdview-0b6b0c1ca1095e77fcceccd451ac1f684ed46003.tar.gz mpdview-0b6b0c1ca1095e77fcceccd451ac1f684ed46003.tar.bz2 mpdview-0b6b0c1ca1095e77fcceccd451ac1f684ed46003.tar.xz mpdview-0b6b0c1ca1095e77fcceccd451ac1f684ed46003.tar.zst mpdview-0b6b0c1ca1095e77fcceccd451ac1f684ed46003.zip |
WIP
-rw-r--r-- | src/c_mpdview.c | 6 | ||||
-rw-r--r-- | src/c_mpdview.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/c_mpdview.c b/src/c_mpdview.c index 4b0eece..a00c5d2 100644 --- a/src/c_mpdview.c +++ b/src/c_mpdview.c @@ -70,9 +70,10 @@ main struct mpd_connection* conn; struct mpd_status* status; struct mpd_song* song; + enum mpd_state state; + long read_size; char buff[BUFF_SIZE]; /* char* uri; */ - enum mpd_state state; (void)argc; (void)argv; @@ -100,7 +101,8 @@ main song = mpd_recv_song(conn); mpd_response_finish(conn); bzero(buff, BUFF_SIZE); - if (mpd_run_albumart(conn, mpd_song_get_uri(song), 0, buff, BUFF_SIZE) > -1) { + read_size = mpd_run_albumart(conn, mpd_song_get_uri(song), 0, buff, BUFF_SIZE); + if (read_size > -1) { write(STDOUT_FILENO, buff, BUFF_SIZE); } else { diff --git a/src/c_mpdview.h b/src/c_mpdview.h index 21f96b1..4848997 100644 --- a/src/c_mpdview.h +++ b/src/c_mpdview.h @@ -46,7 +46,7 @@ #ifndef __C_MPDVIEW_H__ #define __C_MPDVIEW_H__ -#define BUFF_SIZE 8192 +#define BUFF_SIZE 262144 #define PROGNAME "mpdview" typedef char bool_t; |