[FFmpeg-devel,12/20] avformat/(lrc|scc)enc: Use avio_w8() to write a single char

Message ID AM7PR03MB66608C21DA32E2238958C4F38FAB9@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit 2b2e9afdd2b435fd5f6f1f0216c89a1f71aeb1be
Headers
Series [FFmpeg-devel,01/20] libpostproc/postprocess_template: Don't reimplement FFSWAP |

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Oct. 1, 2021, 9:08 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/lrcenc.c | 2 +-
 libavformat/sccenc.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
  

Comments

Paul B Mahol Oct. 2, 2021, 3:03 p.m. UTC | #1
lgtm
  

Patch

diff --git a/libavformat/lrcenc.c b/libavformat/lrcenc.c
index 5d107cd49a..0de0bb18f4 100644
--- a/libavformat/lrcenc.c
+++ b/libavformat/lrcenc.c
@@ -79,7 +79,7 @@  static int lrc_write_header(AVFormatContext *s)
         avio_printf(s->pb, "[%s:%s]\n",
                     metadata_item->key, metadata_item->value);
     }
-    avio_printf(s->pb, "\n");
+    avio_w8(s->pb, '\n');
     return 0;
 }
 
diff --git a/libavformat/sccenc.c b/libavformat/sccenc.c
index a40d84cb4e..c8c4d097e4 100644
--- a/libavformat/sccenc.c
+++ b/libavformat/sccenc.c
@@ -94,12 +94,12 @@  static int scc_write_packet(AVFormatContext *avf, AVPacket *pkt)
             scc->inside = 1;
         }
         if (scc->n > 0)
-            avio_printf(avf->pb, " ");
+            avio_w8(avf->pb, ' ');
         avio_printf(avf->pb, "%02x%02x", pkt->data[i + 1], pkt->data[i + 2]);
         scc->n++;
     }
     if (scc->inside && (scc->prev_h != h || scc->prev_m != m || scc->prev_s != s || scc->prev_f != f)) {
-        avio_printf(avf->pb, "\n");
+        avio_w8(avf->pb, '\n');
         scc->n = 0;
         scc->inside = 0;
     }