diff mbox series

[FFmpeg-devel] avfilter/vf_vidstabdetect: force ASCII mode if possible

Message ID 20230707134553.13643-1-timo@rothenpieler.org
State New
Headers show
Series [FFmpeg-devel] avfilter/vf_vidstabdetect: force ASCII mode if possible | expand

Checks

Context Check Description
yinshiyou/commit_msg_loongarch64 warning Please wrap lines in the body of the commit message between 60 and 72 characters.
andriy/commit_msg_x86 warning Please wrap lines in the body of the commit message between 60 and 72 characters.
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Timo Rothenpieler July 7, 2023, 1:45 p.m. UTC
Newer versions of the library added a new binary output format, and prefer using it by default.
Those binary files seem to cause issues for a lot of users, where ffmpeg fails to (sometimes?) read
back the trf file it has just written itself.

My guess is that this might be because of the fopen-mode of "w" below, where "wb" would be needed.
But since we can't really know what format the library is about to write, it's better to force
it into ASCII mode when possible.
---
 libavfilter/vf_vidstabdetect.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/libavfilter/vf_vidstabdetect.c b/libavfilter/vf_vidstabdetect.c
index b27b1e40a6..7170f56f81 100644
--- a/libavfilter/vf_vidstabdetect.c
+++ b/libavfilter/vf_vidstabdetect.c
@@ -110,6 +110,10 @@  static int config_input(AVFilterLink *inlink)
         return AVERROR(EINVAL);
     }
 
+#ifdef ASCII_SERIALIZATION_MODE
+    md->serializationMode = ASCII_SERIALIZATION_MODE;
+#endif
+
     // set values that are not initialized by the options
     s->conf.algo     = 1;
     s->conf.modName  = "vidstabdetect";