1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avformat/hlsplaylist: simplify code for checking whether the string is empty

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
This commit is contained in:
Limin Wang 2020-03-26 21:56:58 +08:00 committed by Steven Liu
parent e2e8ef5076
commit 73dc87c4f0

View File

@ -65,11 +65,11 @@ void ff_hls_write_stream_info(AVStream *st, AVIOContext *out,
if (st && st->codecpar->width > 0 && st->codecpar->height > 0) if (st && st->codecpar->width > 0 && st->codecpar->height > 0)
avio_printf(out, ",RESOLUTION=%dx%d", st->codecpar->width, avio_printf(out, ",RESOLUTION=%dx%d", st->codecpar->width,
st->codecpar->height); st->codecpar->height);
if (codecs && strlen(codecs) > 0) if (codecs && codecs[0])
avio_printf(out, ",CODECS=\"%s\"", codecs); avio_printf(out, ",CODECS=\"%s\"", codecs);
if (agroup && strlen(agroup) > 0) if (agroup && agroup[0])
avio_printf(out, ",AUDIO=\"group_%s\"", agroup); avio_printf(out, ",AUDIO=\"group_%s\"", agroup);
if (ccgroup && strlen(ccgroup) > 0) if (ccgroup && ccgroup[0])
avio_printf(out, ",CLOSED-CAPTIONS=\"%s\"", ccgroup); avio_printf(out, ",CLOSED-CAPTIONS=\"%s\"", ccgroup);
avio_printf(out, "\n%s\n\n", filename); avio_printf(out, "\n%s\n\n", filename);
} }