Lines Matching refs:rmd
715 raop_metadata_free(struct raop_metadata *rmd)
717 evbuffer_free(rmd->metadata);
718 if (rmd->artwork)
719 evbuffer_free(rmd->artwork);
720 free(rmd);
726 struct raop_metadata *rmd;
728 for (rmd = metadata_head; rmd; rmd = metadata_head)
730 metadata_head = rmd->next;
732 raop_metadata_free(rmd);
741 struct raop_metadata *rmd;
743 for (rmd = metadata_head; rmd; rmd = metadata_head)
745 if (rmd->end >= rtptime)
749 metadata_tail = rmd->next;
751 metadata_head = rmd->next;
753 raop_metadata_free(rmd);
763 struct raop_metadata *rmd;
768 rmd = (struct raop_metadata *)malloc(sizeof(struct raop_metadata));
769 if (!rmd)
776 memset(rmd, 0, sizeof(struct raop_metadata));
818 rmd->metadata = evbuffer_new();
819 if (!rmd->metadata)
827 ret = dmap_encode_file_metadata(rmd->metadata, tmp, &dbmfi, NULL, 0, 0, 1);
845 rmd->start = rtptime;
846 rmd->end = rtptime + (duration * 44100UL) / 1000UL;
849 rmd->artwork = evbuffer_new();
850 if (!rmd->artwork)
857 ret = artwork_get_item_filename(dbmfi.path, 600, 600, ART_CAN_PNG | ART_CAN_JPEG, rmd->artwork);
862 evbuffer_free(rmd->artwork);
863 rmd->artwork = NULL;
866 rmd->artwork_fmt = ret;
871 /* Add rmd to metadata list */
873 metadata_tail->next = rmd;
876 metadata_head = rmd;
877 metadata_tail = rmd;
880 return rmd;
883 evbuffer_free(rmd->metadata);
887 free(rmd);
2005 raop_metadata_send_progress(struct raop_session *rs, struct evbuffer *evbuf, struct raop_metadata *rmd, uint64_t offset, uint32_t delay)
2022 display = RAOP_RTPTIME(rmd->start - delay);
2024 ret = evbuffer_add_printf(evbuf, "progress: %u/%u/%u\r\n", display, RAOP_RTPTIME(rmd->start + offset), RAOP_RTPTIME(rmd->end));
2040 raop_metadata_send_artwork(struct raop_session *rs, struct evbuffer *evbuf, struct raop_metadata *rmd, char *rtptime)
2045 switch (rmd->artwork_fmt)
2056 DPRINTF(E_LOG, L_RAOP, "Unsupported artwork format %d\n", rmd->artwork_fmt);
2061 ret = evbuffer_add(evbuf, EVBUFFER_DATA(rmd->artwork), EVBUFFER_LENGTH(rmd->artwork));
2077 raop_metadata_send_metadata(struct raop_session *rs, struct evbuffer *evbuf, struct raop_metadata *rmd, char *rtptime)
2081 ret = evbuffer_add(evbuf, EVBUFFER_DATA(rmd->metadata), EVBUFFER_LENGTH(rmd->metadata));
2097 raop_metadata_send_internal(struct raop_session *rs, struct raop_metadata *rmd, uint64_t offset, uint32_t delay)
2111 ret = snprintf(rtptime, sizeof(rtptime), "rtptime=%u", RAOP_RTPTIME(rmd->start));
2120 ret = raop_metadata_send_metadata(rs, evbuf, rmd, rtptime);
2129 if (!rmd->artwork)
2132 ret = raop_metadata_send_artwork(rs, evbuf, rmd, rtptime);
2142 ret = raop_metadata_send_progress(rs, evbuf, rmd, offset, delay);
2160 struct raop_metadata *rmd;
2169 for (rmd = metadata_head; rmd; rmd = rmd->next)
2172 if ((rs->start_rtptime >= rmd->start) && (rs->start_rtptime < rmd->end))
2174 offset = rs->start_rtptime - rmd->start;
2176 ret = raop_metadata_send_internal(rs, rmd, offset, RAOP_MD_DELAY_STARTUP);
2187 else if (sent && (rs->start_rtptime < rmd->start))
2189 ret = raop_metadata_send_internal(rs, rmd, 0, RAOP_MD_DELAY_SWITCH);
2204 struct raop_metadata *rmd;
2208 rmd = raop_metadata_prepare(id, rtptime);
2209 if (!rmd)
2222 ret = raop_metadata_send_internal(rs, rmd, offset, delay);