]> git.sesse.net Git - ffmpeg/commit
avformat/yuv4mpegenc: Simplify writing global and packet headers
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 4 Sep 2020 10:36:41 +0000 (12:36 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 4 Sep 2020 15:34:26 +0000 (17:34 +0200)
commita162fa0772ab79fab503a7f2a5c7bb63e970cbfc
treed95fce4658d26e15fa7d4196edd3785765d364f0
parentc8e38950e3aad0304ec861aa4985b866dceddc7c
avformat/yuv4mpegenc: Simplify writing global and packet headers

YUV4MPEG writes a string as header for both the file itself as well as
for every frame; these strings contain magic strings and these were up
until now included in the string to write via %s. Yet they are compile
time constants, so one can use the compile-time string concatentation
instead of inserting these strings at runtime.
Furthermore, the global header has been written via snprintf() to
a local buffer first before writing it. This can be simplified by using
avio_printf().

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/yuv4mpegenc.c