Skip to content

Commit c8a9658

Browse files
committed
Remove mime type out of image output muxing
apng and png have the same priority but the former is first and uses a different codec_id...
1 parent 74fa1ec commit c8a9658

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/coverart.c

+2-7
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,8 @@ int crip_save_art(cyanrip_ctx *ctx, CRIPArt *art, const cyanrip_out_fmt *fmt)
3838
if (!filepath)
3939
return 0;
4040

41-
AVOutputFormat *ofm = av_guess_format(NULL, filepath, art->mime_type);
4241
AVFormatContext *avf = NULL;
43-
44-
ret = avformat_alloc_output_context2(&avf, ofm, NULL, filepath);
42+
ret = avformat_alloc_output_context2(&avf, NULL, NULL, filepath);
4543
if (ret < 0) {
4644
cyanrip_log(ctx, 0, "Unable to init lavf context: %s!\n", av_err2str(ret));
4745
goto fail;
@@ -105,7 +103,6 @@ void crip_free_art(CRIPArt *art)
105103
art->size = 0;
106104

107105
av_freep(&art->source_url);
108-
av_freep(&art->mime_type);
109106
av_freep(&art->extension);
110107

111108
av_dict_free(&art->meta);
@@ -190,8 +187,6 @@ static int fetch_image(cyanrip_ctx *ctx, CURL *curl_ctx, CRIPArt *art,
190187
goto end;
191188
}
192189

193-
art->mime_type = av_strdup(content_type);
194-
195190
/* Response code */
196191
long response_code = 0;
197192
res = curl_easy_getinfo(curl_ctx, CURLINFO_RESPONSE_CODE, &response_code);
@@ -219,7 +214,7 @@ static int fetch_image(cyanrip_ctx *ctx, CURL *curl_ctx, CRIPArt *art,
219214
art->size = 0;
220215
} else {
221216
char header[99];
222-
snprintf(header, sizeof(header), "data:%s;base64,", art->mime_type);
217+
snprintf(header, sizeof(header), "data:%s;base64,", content_type);
223218

224219
size_t data_len = AV_BASE64_SIZE(art->size);
225220
char *data = av_mallocz(strlen(header) + data_len);

src/cyanrip_main.h

-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ typedef struct CRIPArt {
115115
AVDictionary *meta;
116116
char *source_url;
117117
char *title; /* Temporary, used during parsing only, copied to meta, do not free */
118-
char *mime_type;
119118

120119
AVPacket *pkt;
121120
AVCodecParameters *params;

0 commit comments

Comments
 (0)