@@ -38,10 +38,8 @@ int crip_save_art(cyanrip_ctx *ctx, CRIPArt *art, const cyanrip_out_fmt *fmt)
38
38
if (!filepath )
39
39
return 0 ;
40
40
41
- AVOutputFormat * ofm = av_guess_format (NULL , filepath , art -> mime_type );
42
41
AVFormatContext * avf = NULL ;
43
-
44
- ret = avformat_alloc_output_context2 (& avf , ofm , NULL , filepath );
42
+ ret = avformat_alloc_output_context2 (& avf , NULL , NULL , filepath );
45
43
if (ret < 0 ) {
46
44
cyanrip_log (ctx , 0 , "Unable to init lavf context: %s!\n" , av_err2str (ret ));
47
45
goto fail ;
@@ -105,7 +103,6 @@ void crip_free_art(CRIPArt *art)
105
103
art -> size = 0 ;
106
104
107
105
av_freep (& art -> source_url );
108
- av_freep (& art -> mime_type );
109
106
av_freep (& art -> extension );
110
107
111
108
av_dict_free (& art -> meta );
@@ -190,8 +187,6 @@ static int fetch_image(cyanrip_ctx *ctx, CURL *curl_ctx, CRIPArt *art,
190
187
goto end ;
191
188
}
192
189
193
- art -> mime_type = av_strdup (content_type );
194
-
195
190
/* Response code */
196
191
long response_code = 0 ;
197
192
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,
219
214
art -> size = 0 ;
220
215
} else {
221
216
char header [99 ];
222
- snprintf (header , sizeof (header ), "data:%s;base64," , art -> mime_type );
217
+ snprintf (header , sizeof (header ), "data:%s;base64," , content_type );
223
218
224
219
size_t data_len = AV_BASE64_SIZE (art -> size );
225
220
char * data = av_mallocz (strlen (header ) + data_len );
0 commit comments