[FFmpeg-devel] [PATCH 01/10] lavu: add av_fourcc_make_string() and av_4cc2str()
Clément Bœsch
u at pkh.me
Tue Mar 28 19:16:03 EEST 2017
On Tue, Mar 28, 2017 at 06:12:14PM +0200, Michael Niedermayer wrote:
> On Tue, Mar 28, 2017 at 10:19:46AM +0200, Clément Bœsch wrote:
> [...]
> > diff --git a/libavutil/utils.c b/libavutil/utils.c
> > index 36e4dd5fdb..29f2746338 100644
> > --- a/libavutil/utils.c
> > +++ b/libavutil/utils.c
> > @@ -121,6 +121,29 @@ unsigned av_int_list_length_for_size(unsigned elsize,
> > return i;
> > }
> >
> > +char *av_fourcc_make_string(char *buf, uint32_t fourcc)
> > +{
> > + int i;
> > + char *orig_buf = buf;
> > + size_t buf_size = AV_FOURCC_MAX_STRING_SIZE;
> > +
> > + for (i = 0; i < 4; i++) {
> > + const char c = fourcc & 0xff;
> > + const int print_chr = (c >= '0' && c <= '9') ||
> > + (c >= 'a' && c <= 'z') ||
> > + (c >= 'A' && c <= 'Z') ||
> > + (c && strchr(". -_", c));
> > + const int len = snprintf(buf, buf_size, print_chr ? "%c" : "[%d]", c);
>
> this prints values over 127 as negative if char is signed
>
oh i thought i changed that to const int c = ...
forgot to resend the patch, consider it fixed locally
--
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170328/15fa51a4/attachment.sig>
More information about the ffmpeg-devel
mailing list