From 56ece92209467c1bcf5893120fd856ad1c4376f6 Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Thu, 2 Apr 2015 00:09:12 +0200 Subject: [PATCH] Remember to actually request ICY metadata in transcode.c --- src/transcode.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/transcode.c b/src/transcode.c index 47ea6aca..a0a0fe14 100644 --- a/src/transcode.c +++ b/src/transcode.c @@ -486,6 +486,7 @@ transcode_seek(struct transcode_ctx *ctx, int ms) int transcode_setup(struct transcode_ctx **nctx, struct media_file_info *mfi, off_t *est_size, int wavhdr) { + AVDictionary *options; struct transcode_ctx *ctx; int ret; @@ -498,6 +499,8 @@ transcode_setup(struct transcode_ctx **nctx, struct media_file_info *mfi, off_t } memset(ctx, 0, sizeof(struct transcode_ctx)); + options = NULL; + #if LIBAVFORMAT_VERSION_MAJOR >= 54 || (LIBAVFORMAT_VERSION_MAJOR == 53 && LIBAVFORMAT_VERSION_MINOR >= 3) # ifndef HAVE_FFMPEG // Without this, libav is slow to probe some internet streams, which leads to RAOP timeouts @@ -507,8 +510,13 @@ transcode_setup(struct transcode_ctx **nctx, struct media_file_info *mfi, off_t ctx->fmtctx->probesize = 64000; } # endif + if (mfi->data_kind == 1) + av_dict_set(&options, "icy", "1", 0); - ret = avformat_open_input(&ctx->fmtctx, mfi->path, NULL, NULL); + ret = avformat_open_input(&ctx->fmtctx, mfi->path, NULL, &options); + + if (options) + av_dict_free(&options); #else ret = av_open_input_file(&ctx->fmtctx, mfi->path, NULL, 0, NULL); #endif