Skip to content

Commit f579a1d

Browse files
softworkzmstorsjo
authored andcommitted
avfilter: use avpriv_fopen_utf8() instead of plain fopen()
Unify file access operations by replacing usages of direct calls to posix fopen() to prepare for long filename support on Windows. Signed-off-by: softworkz <softworkz@hotmail.com> Signed-off-by: Martin Storsjö <martin@martin.st>
1 parent d2ef44f commit f579a1d

File tree

8 files changed

+9
-9
lines changed

8 files changed

+9
-9
lines changed

libavfilter/af_firequalizer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ static int generate_kernel(AVFilterContext *ctx, const char *gain, const char *g
604604
if (ret < 0)
605605
return ret;
606606

607-
if (s->dumpfile && (!s->dump_buf || !s->analysis_rdft || !(dump_fp = fopen(s->dumpfile, "w"))))
607+
if (s->dumpfile && (!s->dump_buf || !s->analysis_rdft || !(dump_fp = avpriv_fopen_utf8(s->dumpfile, "w"))))
608608
av_log(ctx, AV_LOG_WARNING, "dumping failed.\n");
609609

610610
vars[VAR_CHS] = inlink->ch_layout.nb_channels;

libavfilter/vf_deshake.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ static av_cold int init(AVFilterContext *ctx)
353353
}
354354

355355
if (deshake->filename)
356-
deshake->fp = fopen(deshake->filename, "w");
356+
deshake->fp = avpriv_fopen_utf8(deshake->filename, "w");
357357
if (deshake->fp)
358358
fwrite("Ori x, Avg x, Fin x, Ori y, Avg y, Fin y, Ori angle, Avg angle, Fin angle, Ori zoom, Avg zoom, Fin zoom\n", 1, 104, deshake->fp);
359359

libavfilter/vf_psnr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ static av_cold int init(AVFilterContext *ctx)
280280
if (!strcmp(s->stats_file_str, "-")) {
281281
s->stats_file = stdout;
282282
} else {
283-
s->stats_file = fopen(s->stats_file_str, "w");
283+
s->stats_file = avpriv_fopen_utf8(s->stats_file_str, "w");
284284
if (!s->stats_file) {
285285
int err = AVERROR(errno);
286286
char buf[128];

libavfilter/vf_signature.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ static int xml_export(AVFilterContext *ctx, StreamContext *sc, const char* filen
386386
FILE* f;
387387
unsigned int pot3[5] = { 3*3*3*3, 3*3*3, 3*3, 3, 1 };
388388

389-
f = fopen(filename, "w");
389+
f = avpriv_fopen_utf8(filename, "w");
390390
if (!f) {
391391
int err = AVERROR(EINVAL);
392392
char buf[128];
@@ -500,7 +500,7 @@ static int binary_export(AVFilterContext *ctx, StreamContext *sc, const char* fi
500500
if (!buffer)
501501
return AVERROR(ENOMEM);
502502

503-
f = fopen(filename, "wb");
503+
f = avpriv_fopen_utf8(filename, "wb");
504504
if (!f) {
505505
int err = AVERROR(EINVAL);
506506
char buf[128];

libavfilter/vf_ssim.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ static av_cold int init(AVFilterContext *ctx)
404404
if (!strcmp(s->stats_file_str, "-")) {
405405
s->stats_file = stdout;
406406
} else {
407-
s->stats_file = fopen(s->stats_file_str, "w");
407+
s->stats_file = avpriv_fopen_utf8(s->stats_file_str, "w");
408408
if (!s->stats_file) {
409409
int err = AVERROR(errno);
410410
char buf[128];

libavfilter/vf_vidstabdetect.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static int config_input(AVFilterLink *inlink)
126126
av_log(ctx, AV_LOG_INFO, " show = %d\n", s->conf.show);
127127
av_log(ctx, AV_LOG_INFO, " result = %s\n", s->result);
128128

129-
s->f = fopen(s->result, "w");
129+
s->f = avpriv_fopen_utf8(s->result, "w");
130130
if (s->f == NULL) {
131131
av_log(ctx, AV_LOG_ERROR, "cannot open transform file %s\n", s->result);
132132
return AVERROR(EINVAL);

libavfilter/vf_vidstabtransform.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ static int config_input(AVFilterLink *inlink)
191191
av_log(ctx, AV_LOG_INFO, " zoomspeed = %g\n", tc->conf.zoomSpeed);
192192
av_log(ctx, AV_LOG_INFO, " interpol = %s\n", getInterpolationTypeName(tc->conf.interpolType));
193193

194-
f = fopen(tc->input, "r");
194+
f = avpriv_fopen_utf8(tc->input, "r");
195195
if (!f) {
196196
int ret = AVERROR(errno);
197197
av_log(ctx, AV_LOG_ERROR, "cannot open input file %s\n", tc->input);

libavfilter/vf_vmafmotion.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ static av_cold int init(AVFilterContext *ctx)
312312
if (!strcmp(s->stats_file_str, "-")) {
313313
s->stats_file = stdout;
314314
} else {
315-
s->stats_file = fopen(s->stats_file_str, "w");
315+
s->stats_file = avpriv_fopen_utf8(s->stats_file_str, "w");
316316
if (!s->stats_file) {
317317
int err = AVERROR(errno);
318318
char buf[128];

0 commit comments

Comments
 (0)