Remove player metadata event timer (use the existing instead)

This commit is contained in:
ejurgensen
2015-04-11 20:30:31 +02:00
parent 0397b824a5
commit 99cda05dab
4 changed files with 22 additions and 49 deletions

View File

@@ -63,6 +63,8 @@
# define XCODE_BUFFER_SIZE ((AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2)
#endif
/* Interval between ICY metadata checks for streams, in seconds */
#define METADATA_ICY_INTERVAL 5
struct transcode_ctx {
AVFormatContext *fmtctx;
@@ -153,7 +155,7 @@ make_wav_header(struct transcode_ctx *ctx, off_t *est_size)
int
transcode(struct transcode_ctx *ctx, struct evbuffer *evbuf, int wanted)
transcode(struct transcode_ctx *ctx, struct evbuffer *evbuf, int wanted, int *icy_timer)
{
int16_t *buf;
int buflen;
@@ -393,6 +395,7 @@ transcode(struct transcode_ctx *ctx, struct evbuffer *evbuf, int wanted)
av_free(frame);
#endif
*icy_timer = (ctx->offset % (METADATA_ICY_INTERVAL * 2 * 2 * 44100) < processed);
return processed;
}