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); |
618 } | 619 } |
619 else | 620 else |
620 LIBMTP_ERROR("failed to find filepath for track=%d\n", tracks[i]); | 621 LIBMTP_ERROR("failed to find filepath for track=%d\n", tracks[i]); |
621 } | 622 } |
622 | 623 |
623 // FOOTER | 624 // FOOTER |
624 append_text_t(&c, ""); | 625 append_text_t(&c, ""); |
625 append_text_t(&c, "END PLAYLIST"); | 626 append_text_t(&c, "END PLAYLIST"); |
626 if(ver_major == 2) { | 627 if(ver_major == 2) { |
627 append_text_t(&c, ""); | 628 append_text_t(&c, ""); |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 { | 840 { |
840 if(*t == NULL) { | 841 if(*t == NULL) { |
841 *t = malloc(sizeof(text_t)); | 842 *t = malloc(sizeof(text_t)); |
842 } | 843 } |
843 else { | 844 else { |
844 (*t)->next = malloc(sizeof(text_t)); | 845 (*t)->next = malloc(sizeof(text_t)); |
845 (*t) = (*t)->next; | 846 (*t) = (*t)->next; |
846 } | 847 } |
847 (*t)->text = strdup(s); | 848 (*t)->text = strdup(s); |
848 } | 849 } |
OLD | NEW |