X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=playlist.c;h=ba99fad269ff740934ecec731166b01d3efdd7d1;hp=429ad2b53a116ffc1da2d4710b51e6db39161324;hb=32facbd1b7948f146515e53194cfd4f33c54353f;hpb=15151d60026dfe17cfaad02284d0abbb8b9389b2;ds=sidebyside diff --git a/playlist.c b/playlist.c index 429ad2b5..ba99fad2 100644 --- a/playlist.c +++ b/playlist.c @@ -47,18 +47,6 @@ static int add_playlist_entry(char *path, void *data) return 1; } -static int get_playlist_data(struct osl_row *row, char **playlist_name, - struct osl_object *playlist_def) -{ - struct osl_object obj; - int ret = osl_get_object(playlists_table, row, BLOBCOL_NAME, &obj); - if (ret < 0) - return ret; - *playlist_name = obj.data; - return osl_open_disk_object(playlists_table, row, BLOBCOL_DEF, - playlist_def); -} - /* returns -E_PLAYLIST_LOADED on _success_ to terminate the loop */ static int load_playlist(struct osl_row *row, void *data) { @@ -67,7 +55,7 @@ static int load_playlist(struct osl_row *row, void *data) char *playlist_name; int ret; - ret = get_playlist_data(row, &playlist_name, &playlist_def); + ret = pl_get_name_and_def_by_row(row, &playlist_name, &playlist_def); if (ret < 0) goto err; playlist->length = 0; @@ -118,7 +106,7 @@ static int check_playlist(struct osl_row *row, void *data) struct para_buffer *pb = data; struct osl_object playlist_def; char *playlist_name; - int ret = get_playlist_data(row, &playlist_name, &playlist_def); + int ret = pl_get_name_and_def_by_row(row, &playlist_name, &playlist_def); if (ret < 0) { para_printf(pb, "failed to get playlist data: %s\n", @@ -134,6 +122,14 @@ static int check_playlist(struct osl_row *row, void *data) return 1; } +/** + * Check the playlist table for inconsistencies. + * + * \param query Unused. + * \param result Contains messages about inconsistencies. + * + * \return The return value of the underlying call to osl_rbtree_loop(). + */ int playlist_check_callback(__a_unused const struct osl_object *query, struct osl_object *result) {