Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package kew for openSUSE:Factory checked in at 2024-03-27 20:42:35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kew (Old) and /work/SRC/openSUSE:Factory/.kew.new.1905 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kew" Wed Mar 27 20:42:35 2024 rev:16 rq:1162489 version:2.4.4 Changes: -------- --- /work/SRC/openSUSE:Factory/kew/kew.changes 2024-03-13 22:19:37.130572109 +0100 +++ /work/SRC/openSUSE:Factory/.kew.new.1905/kew.changes 2024-03-27 20:43:06.386312245 +0100 @@ -1,0 +2,11 @@ +Wed Mar 27 03:33:29 UTC 2024 - Muhammad Akbar Yanuar Mantari <mantari...@pm.me> + +- Update to version 2.4.4 + * Fixed no sound when playing a flac or mp3 song twice, then + enqueuing another. + * Don't save every change to the playlist when running the + special playlist w*ith 'kew .', only add the songs added by + pressing '.'. + * Removed a compiler warning and a few other minor fixes. + +------------------------------------------------------------------- Old: ---- kew-2.4.3.tar.gz New: ---- kew-2.4.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kew.spec ++++++ --- /var/tmp/diff_new_pack.0R1wgx/_old 2024-03-27 20:43:06.926332155 +0100 +++ /var/tmp/diff_new_pack.0R1wgx/_new 2024-03-27 20:43:06.930332303 +0100 @@ -17,7 +17,7 @@ Name: kew -Version: 2.4.3 +Version: 2.4.4 Release: 0 Summary: A command-line music player License: GPL-2.0-only ++++++ kew-2.4.3.tar.gz -> kew-2.4.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kew-2.4.3/README.md new/kew-2.4.4/README.md --- old/kew-2.4.3/README.md 2024-03-09 09:59:46.000000000 +0100 +++ new/kew-2.4.4/README.md 2024-03-20 21:56:35.000000000 +0100 @@ -24,14 +24,6 @@ <a href="https://repology.org/project/kew/versions"><img src="https://repology.org/badge/vertical-allrepos/kew.svg" alt="Packaging status" align="right"></a> -### Installing on Debian - -Under Debian Sid/Unstable you can run: - -```bash -$ sudo apt install kew -``` - ### Installing via AUR On Arch Linux, and Arch-based distributions, kew can be found in the AUR. Install with pamac or an AUR helper like yay: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kew-2.4.3/docs/kew-manpage.mdoc new/kew-2.4.4/docs/kew-manpage.mdoc --- old/kew-2.4.3/docs/kew-manpage.mdoc 2024-03-09 09:59:46.000000000 +0100 +++ new/kew-2.4.4/docs/kew-manpage.mdoc 2024-03-20 21:56:35.000000000 +0100 @@ -48,9 +48,9 @@ Hides the cover. .It Fl -noui Completely hides the UI. -.It Fl --quitonstop +.It Fl q, --quitonstop Exits after playing the whole playlist. -.It Fl --exact, -e +.It Fl e, --exact Specifies you want an exact (but not case sensitive) match, of for instance an album. .It shuffle Shuffles the playlist before starting to play it. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kew-2.4.3/docs/kew.1 new/kew-2.4.4/docs/kew.1 --- old/kew-2.4.3/docs/kew.1 2024-03-09 09:59:46.000000000 +0100 +++ new/kew-2.4.4/docs/kew.1 2024-03-20 21:56:35.000000000 +0100 @@ -45,10 +45,10 @@ \fB\--noui\fR Completely hides the UI. .TP 9n -\fB\--quitonstop\fR +\fB\-q,\fR \fB\--quitonstop\fR Exits after playing the whole playlist. .TP 9n -\fB\--exact, -e\fR +\fB\-e,\fR \fB\--exact, Specifies you want an exact (but not case sensitive) match, of for instance an album. .TP 9n shuffle diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kew-2.4.3/src/chafafunc.c new/kew-2.4.4/src/chafafunc.c --- old/kew-2.4.3/src/chafafunc.c 2024-03-09 09:59:46.000000000 +0100 +++ new/kew-2.4.4/src/chafafunc.c 2024-03-20 21:56:35.000000000 +0100 @@ -366,56 +366,80 @@ g_string_free(printable, TRUE); } +float calcAspectRatio() +{ + TermSize term_size; + gint cell_width = -1, cell_height = -1; + + tty_init(); + get_tty_size(&term_size); + + if (term_size.width_cells > 0 && term_size.height_cells > 0 && term_size.width_pixels > 0 && term_size.height_pixels > 0) + { + cell_width = term_size.width_pixels / term_size.width_cells; + cell_height = term_size.height_pixels / term_size.height_cells; + } + + // Set default for some terminals + if (cell_width == -1 && cell_height == -1) + { + cell_width = 8; + cell_height = 16; + } + + return (float)cell_height / (float)cell_width; +} + void printSquareBitmapCentered(FIBITMAP *bitmap, int baseHeight) { - if (bitmap == NULL) - { - return; - } - int pix_width = FreeImage_GetWidth(bitmap); - int pix_height = FreeImage_GetHeight(bitmap); - int n_channels = FreeImage_GetBPP(bitmap) / 8; - unsigned char *pixels = (unsigned char *)FreeImage_GetBits(bitmap); - - TermSize term_size; - GString *printable; - gint cell_width = -1, cell_height = -1; - - tty_init(); - get_tty_size(&term_size); - - if (term_size.width_cells > 0 && term_size.height_cells > 0 && term_size.width_pixels > 0 && term_size.height_pixels > 0) - { - cell_width = term_size.width_pixels / term_size.width_cells; - cell_height = term_size.height_pixels / term_size.height_cells; - } - - // Set default for some terminals - if (cell_width == -1 && cell_height == -1) - { - cell_width = 8; - cell_height = 16; - } - float aspect_ratio_correction = (float)cell_height / (float)cell_width; - - int correctedWidth = (int)(baseHeight * aspect_ratio_correction); - - // Convert image to a printable string - printable = convert_image(pixels, pix_width, pix_height, pix_width * n_channels, CHAFA_PIXEL_BGRA8_UNASSOCIATED, - correctedWidth, baseHeight, cell_width, cell_height); - g_string_append_c(printable, '\0'); - const gchar *delimiters = "\n"; - gchar **lines = g_strsplit(printable->str, delimiters, -1); - - int indentation = ((term_size.width_cells - correctedWidth) / 2) + 1; - - for (int i = 0; lines[i] != NULL; i++) - { - printf("\n%*s%s", indentation, "", lines[i]); - } + if (bitmap == NULL) + { + return; + } + int pix_width = FreeImage_GetWidth(bitmap); + int pix_height = FreeImage_GetHeight(bitmap); + int n_channels = FreeImage_GetBPP(bitmap) / 8; + unsigned char *pixels = (unsigned char *)FreeImage_GetBits(bitmap); + + TermSize term_size; + GString *printable; + gint cell_width = -1, cell_height = -1; - g_strfreev(lines); - g_string_free(printable, TRUE); + tty_init(); + get_tty_size(&term_size); + + if (term_size.width_cells > 0 && term_size.height_cells > 0 && term_size.width_pixels > 0 && term_size.height_pixels > 0) + { + cell_width = term_size.width_pixels / term_size.width_cells; + cell_height = term_size.height_pixels / term_size.height_cells; + } + + // Set default for some terminals + if (cell_width == -1 && cell_height == -1) + { + cell_width = 8; + cell_height = 16; + } + float aspect_ratio_correction = (float)cell_height / (float)cell_width; + + int correctedWidth = (int)(baseHeight * aspect_ratio_correction); + + // Convert image to a printable string + printable = convert_image(pixels, pix_width, pix_height, pix_width * n_channels, CHAFA_PIXEL_BGRA8_UNASSOCIATED, + correctedWidth, baseHeight, cell_width, cell_height); + g_string_append_c(printable, '\0'); + const gchar *delimiters = "\n"; + gchar **lines = g_strsplit(printable->str, delimiters, -1); + + int indentation = ((term_size.width_cells - correctedWidth) / 2) + 1; + + for (int i = 0; lines[i] != NULL; i++) + { + printf("\n%*s%s", indentation, "", lines[i]); + } + + g_strfreev(lines); + g_string_free(printable, TRUE); } void printBitmapCentered(FIBITMAP *bitmap, int width, int height) @@ -469,7 +493,7 @@ { // Calc luminace and use to find Ascii char. unsigned char ch = luminance(r, g, b); - + if (ch > 80 && !(r < g + 20 && r > g - 20 && g < b + 20 && g > b - 20) && !(r > 150 && g > 150 && b > 150)) { *found = true; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kew-2.4.3/src/chafafunc.h new/kew-2.4.4/src/chafafunc.h --- old/kew-2.4.3/src/chafafunc.h 2024-03-09 09:59:46.000000000 +0100 +++ new/kew-2.4.4/src/chafafunc.h 2024-03-20 21:56:35.000000000 +0100 @@ -7,6 +7,7 @@ #include <string.h> #include <unistd.h> +float calcAspectRatio(); void printImage(const char *image_path, int width, int height); FIBITMAP *getBitmap(const char *image_path); void printBitmap(FIBITMAP *bitmap, int width, int height); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kew-2.4.3/src/kew.c new/kew-2.4.4/src/kew.c --- old/kew-2.4.3/src/kew.c 2024-03-09 09:59:46.000000000 +0100 +++ new/kew-2.4.4/src/kew.c 2024-03-20 21:56:35.000000000 +0100 @@ -870,7 +870,7 @@ restoreTerminalMode(); enableInputBuffering(); setConfig(&settings); - saveSpecialPlaylist(settings.path, playingMainPlaylist); + saveSpecialPlaylist(settings.path); freeAudioBuffer(); deleteCache(tempCache); deleteTempDir(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kew-2.4.3/src/player.c new/kew-2.4.4/src/player.c --- old/kew-2.4.3/src/player.c 2024-03-09 09:59:46.000000000 +0100 +++ new/kew-2.4.4/src/player.c 2024-03-20 21:56:35.000000000 +0100 @@ -22,7 +22,7 @@ } PixelData; #endif -const char VERSION[] = "2.4.3"; +const char VERSION[] = "2.4.4"; int mainColor = 6; int titleColor = 6; int artistColor = 6; @@ -152,27 +152,22 @@ int calcIdealImgSize(int *width, int *height, const int visualizerHeight, const int metatagHeight) { + float aspectRatio = calcAspectRatio(); + int term_w, term_h; getTermSize(&term_w, &term_h); int timeDisplayHeight = 1; - int heightMargin = 2; + int heightMargin = 4; int minHeight = visualizerHeight + metatagHeight + timeDisplayHeight + heightMargin; + int minBorderWidth = 0; *height = term_h - minHeight; - *width = ceil(*height * 2); + *width = ceil(*height * aspectRatio); if (*width > term_w) { - *width = term_w; - *height = floor(*width / 2); - } - int remainder = *width % 2; - if (remainder == 1) - { - *width -= 1; + *width = term_w - minBorderWidth; + *height = floor(*width / aspectRatio); } - *width -= 3; - *height -= 2; - return 0; } @@ -298,14 +293,13 @@ int displayCover(FIBITMAP *cover, const char *coverArtPath, int height, bool ansii) { - int width = height * 2; - if (!ansii) { printSquareBitmapCentered(cover, height); } else { + int width = height * 2; output_ascii(coverArtPath, height, width); } printf("\n"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kew-2.4.3/src/playlist.c new/kew-2.4.4/src/playlist.c --- old/kew-2.4.3/src/playlist.c 2024-03-09 09:59:46.000000000 +0100 +++ new/kew-2.4.4/src/playlist.c 2024-03-20 21:56:35.000000000 +0100 @@ -616,27 +616,53 @@ readM3UFile(playlistPath, specialPlaylist); } -void saveSpecialPlaylist(const char *directory, bool isPlayingMain) +void saveSpecialPlaylist(const char *directory) { + if (directory == NULL) + { + return; + } + char playlistPath[MAXPATHLEN]; + playlistPath[0] = '\0'; + c_strcpy(playlistPath, sizeof(playlistPath), directory); + + if (playlistPath[0] == '\0') + { + return; + } + if (playlistPath[strlen(playlistPath) - 1] != '/') strcat(playlistPath, "/"); + strcat(playlistPath, mainPlaylistName); - if (isPlayingMain && playlist.count > 0) - writeM3UFile(playlistPath, &playlist); - else if (specialPlaylist != NULL && specialPlaylist->count > 0) + if (specialPlaylist != NULL && specialPlaylist->count > 0) writeM3UFile(playlistPath, specialPlaylist); } void savePlaylist(const char *path) { + if (path == NULL) + { + return; + } + char playlistPath[MAXPATHLEN]; + playlistPath[0] = '\0'; c_strcpy(playlistPath, sizeof(playlistPath), path); + + if (playlistPath[0] == '\0') + { + return; + } + if (playlistPath[strlen(playlistPath) - 1] != '/') strcat(playlistPath, "/"); + strcat(playlistPath, playlistName); + writeM3UFile(playlistPath, &playlist); } @@ -684,16 +710,16 @@ PlayList deepCopyPlayList(PlayList *originalList) { - PlayList newList = {NULL, NULL, 0, PTHREAD_MUTEX_INITIALIZER}; + PlayList newList = {NULL, NULL, 0, PTHREAD_MUTEX_INITIALIZER}; - deepCopyPlayListOntoList(originalList, &newList); - return newList; + deepCopyPlayListOntoList(originalList, &newList); + return newList; } void deepCopyPlayListOntoList(PlayList *originalList, PlayList *newList) { if (originalList == NULL) - { + { return; } @@ -756,30 +782,38 @@ return -1; } -void addSongToPlayList(PlayList *list, const char *filePath, int playlistMax) { - if (list->count >= playlistMax) return; +void addSongToPlayList(PlayList *list, const char *filePath, int playlistMax) +{ + if (list->count >= playlistMax) + return; - Node *newNode = NULL; - createNode(&newNode, filePath, list->count); - addToList(list, newNode); + Node *newNode = NULL; + createNode(&newNode, filePath, list->count); + addToList(list, newNode); } -void traverseFileSystemEntry(FileSystemEntry *entry, PlayList *list, int playlistMax) { - if (entry == NULL || list->count >= playlistMax) return; +void traverseFileSystemEntry(FileSystemEntry *entry, PlayList *list, int playlistMax) +{ + if (entry == NULL || list->count >= playlistMax) + return; - if (entry->isDirectory == 0) { - addSongToPlayList(list, entry->fullPath, playlistMax); - } + if (entry->isDirectory == 0) + { + addSongToPlayList(list, entry->fullPath, playlistMax); + } - if (entry->isDirectory == 1 && entry->children != NULL) { - traverseFileSystemEntry(entry->children, list, playlistMax); - } + if (entry->isDirectory == 1 && entry->children != NULL) + { + traverseFileSystemEntry(entry->children, list, playlistMax); + } - if (entry->next != NULL) { - traverseFileSystemEntry(entry->next, list, playlistMax); - } + if (entry->next != NULL) + { + traverseFileSystemEntry(entry->next, list, playlistMax); + } } -void createPlayListFromFileSystemEntry(FileSystemEntry *root, PlayList *list, int playlistMax) { - traverseFileSystemEntry(root, list, playlistMax); +void createPlayListFromFileSystemEntry(FileSystemEntry *root, PlayList *list, int playlistMax) +{ + traverseFileSystemEntry(root, list, playlistMax); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kew-2.4.3/src/playlist.h new/kew-2.4.4/src/playlist.h --- old/kew-2.4.3/src/playlist.h 2024-03-09 09:59:46.000000000 +0100 +++ new/kew-2.4.4/src/playlist.h 2024-03-20 21:56:35.000000000 +0100 @@ -72,7 +72,7 @@ void loadSpecialPlaylist(const char *directory); -void saveSpecialPlaylist(const char *directory, bool isPlayingMain); +void saveSpecialPlaylist(const char *directory); void savePlaylist(const char *path); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kew-2.4.3/src/playlist_ui.c new/kew-2.4.4/src/playlist_ui.c --- old/kew-2.4.3/src/playlist_ui.c 2024-03-09 09:59:46.000000000 +0100 +++ new/kew-2.4.4/src/playlist_ui.c 2024-03-20 21:56:35.000000000 +0100 @@ -60,7 +60,7 @@ } } -int displayPlaylistItems(Node *startNode, int startIter, int maxListSize, int termWidth, int indent, bool startFromCurrent, int chosenSong, int *chosenNodeId) +int displayPlaylistItems(Node *startNode, int startIter, int maxListSize, int termWidth, int indent, int chosenSong, int *chosenNodeId) { int numPrintedRows = 0; Node *node = startNode; @@ -161,7 +161,7 @@ startNode = startNode->next; } - int printedRows = displayPlaylistItems(startNode, startIter, maxListSize, termWidth, indent, startFromCurrent, *chosenSong, chosenNodeId); + int printedRows = displayPlaylistItems(startNode, startIter, maxListSize, termWidth, indent, *chosenSong, chosenNodeId); if (printedRows > 1) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kew-2.4.3/src/songloader.c new/kew-2.4.4/src/songloader.c --- old/kew-2.4.3/src/songloader.c 2024-03-09 09:59:46.000000000 +0100 +++ new/kew-2.4.4/src/songloader.c 2024-03-20 21:56:35.000000000 +0100 @@ -83,7 +83,7 @@ } } -// Extracts metadata, returns -1 if no album cover found and -2 if no file found +// Extracts metadata, returns -1 if no album cover found, -2 if no file found or if file has errors int extractTags(const char *input_file, TagSettings *tag_settings, double *duration, const char *coverFilePath) { AVFormatContext *fmt_ctx = NULL; @@ -147,6 +147,7 @@ else { *duration = 0.0; + return -2; } int stream_index = av_find_best_stream(fmt_ctx, AVMEDIA_TYPE_VIDEO, -1, -1, NULL, 0); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kew-2.4.3/src/soundbuiltin.c new/kew-2.4.4/src/soundbuiltin.c --- old/kew-2.4.3/src/soundbuiltin.c 2024-03-09 09:59:46.000000000 +0100 +++ new/kew-2.4.4/src/soundbuiltin.c 2024-03-20 21:56:35.000000000 +0100 @@ -128,9 +128,9 @@ ma_decoder *decoder = getCurrentBuiltinDecoder(); - if ((getCurrentImplementationType() != BUILTIN && !isSkipToNext()) || decoder == NULL) + if ((getCurrentImplementationType() != BUILTIN && !isSkipToNext())) { - pthread_mutex_unlock(&dataSourceMutex); + pthread_mutex_unlock(&dataSourceMutex); return; } @@ -161,12 +161,13 @@ ma_uint64 cursor = 0; ma_result result; - if (decoder == NULL || firstDecoder == NULL) - { + if (firstDecoder == NULL) + { pthread_mutex_unlock(&dataSourceMutex); return; } - result = ma_data_source_read_pcm_frames(firstDecoder, (ma_int32 *)pFramesOut + framesRead * decoder->outputChannels, remainingFrames, &framesToRead); + + result = ma_data_source_read_pcm_frames(firstDecoder, (ma_int32 *)pFramesOut + framesRead * audioData->channels, remainingFrames, &framesToRead); ma_data_source_get_cursor_in_pcm_frames(decoder, &cursor); if (((audioData->totalFrames != 0 && cursor != 0 && cursor >= audioData->totalFrames) || framesToRead == 0 || isSkipToNext() || result != MA_SUCCESS) && !isEOFReached()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kew-2.4.3/src/soundcommon.c new/kew-2.4.4/src/soundcommon.c --- old/kew-2.4.3/src/soundcommon.c 2024-03-09 09:59:46.000000000 +0100 +++ new/kew-2.4.4/src/soundcommon.c 2024-03-20 21:56:35.000000000 +0100 @@ -1145,7 +1145,7 @@ snprintf(message, sizeof(message), "%s", sanitizedTitle); } - char *args[] = {"notify-send", "-a", "kew", message, "--icon", sanitized_cover, NULL}; + char *args[] = {"/usr/bin/notify-send", "-a", "kew", message, "--icon", sanitized_cover, NULL}; pid_t pid = fork(); if (pid == -1) { @@ -1159,8 +1159,7 @@ // Child process extern char **environ; if (execve("/usr/bin/notify-send", args, environ) == -1) { - // Handle error - perror("execve"); + _Exit(EXIT_FAILURE); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kew-2.4.3/src/visuals.c new/kew-2.4.4/src/visuals.c --- old/kew-2.4.3/src/visuals.c 2024-03-09 09:59:46.000000000 +0100 +++ new/kew-2.4.4/src/visuals.c 2024-03-20 21:56:35.000000000 +0100 @@ -14,7 +14,7 @@ int bufferSize = 4800; int prevBufferSize = 0; -float alpha = 0.1; +float alpha = 0.05; float lastMax = 90; bool unicodeSupport = false; fftwf_complex *fftInput = NULL; @@ -25,11 +25,20 @@ float magnitudeBuffer[MAX_BUFFER_SIZE] = {0.0f}; float lastMagnitudes[MAX_BUFFER_SIZE] = {0.0f}; -void initVisuals() +int terminalSupportsUnicode() { - unicodeSupport = false; char *locale = setlocale(LC_ALL, ""); if (locale != NULL) + return 1; + + return 0; +} + +void initVisuals() +{ + unicodeSupport = false; + + if (terminalSupportsUnicode() > 0) unicodeSupport = true; }