OLD | NEW |
1 /** | 1 /** |
2 * \File playlist-spl.c | 2 * \File playlist-spl.c |
3 * | 3 * |
4 * Playlist_t to Samsung (.spl) and back conversion functions. | 4 * Playlist_t to Samsung (.spl) and back conversion functions. |
5 * | 5 * |
6 * Copyright (C) 2008 Alistair Boyle <alistair.js.boyle@gmail.com> | 6 * Copyright (C) 2008 Alistair Boyle <alistair.js.boyle@gmail.com> |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 | 608 |
609 // TRACKS | 609 // TRACKS |
610 int i; | 610 int i; |
611 char* f; | 611 char* f; |
612 for(i=0;i<trackno;i++) { | 612 for(i=0;i<trackno;i++) { |
613 discover_filepath_from_id(&f, tracks[i], folders, files); | 613 discover_filepath_from_id(&f, tracks[i], folders, files); |
614 | 614 |
615 if(f != NULL) { | 615 if(f != NULL) { |
616 append_text_t(&c, f); | 616 append_text_t(&c, f); |
617 LIBMTP_PLST_DEBUG("track %d = %s (%u)\n", i+1, f, tracks[i]); | 617 LIBMTP_PLST_DEBUG("track %d = %s (%u)\n", i+1, f, tracks[i]); |
618 free(f); | |
619 } | 618 } |
620 else | 619 else |
621 LIBMTP_ERROR("failed to find filepath for track=%d\n", tracks[i]); | 620 LIBMTP_ERROR("failed to find filepath for track=%d\n", tracks[i]); |
622 } | 621 } |
623 | 622 |
624 // FOOTER | 623 // FOOTER |
625 append_text_t(&c, ""); | 624 append_text_t(&c, ""); |
626 append_text_t(&c, "END PLAYLIST"); | 625 append_text_t(&c, "END PLAYLIST"); |
627 if(ver_major == 2) { | 626 if(ver_major == 2) { |
628 append_text_t(&c, ""); | 627 append_text_t(&c, ""); |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 { | 839 { |
841 if(*t == NULL) { | 840 if(*t == NULL) { |
842 *t = malloc(sizeof(text_t)); | 841 *t = malloc(sizeof(text_t)); |
843 } | 842 } |
844 else { | 843 else { |
845 (*t)->next = malloc(sizeof(text_t)); | 844 (*t)->next = malloc(sizeof(text_t)); |
846 (*t) = (*t)->next; | 845 (*t) = (*t)->next; |
847 } | 846 } |
848 (*t)->text = strdup(s); | 847 (*t)->text = strdup(s); |
849 } | 848 } |
OLD | NEW |