diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-02-24 07:46:22 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-02-28 17:14:22 +0100 |
commit | 546e3964ddd3762b22860cc581e23ba6d1443a95 (patch) | |
tree | eb17eac7dd9717dd44bb15d61dbcfd806218dde9 | |
parent | 0f906be430e9eeff9bcbd787ca46374e8b6097da (diff) | |
download | ffmpeg-546e3964ddd3762b22860cc581e23ba6d1443a95.tar.gz |
avformat/webmdashenc: Use av_strstart instead of strncmp
It makes the intent clearer and avoids calculating the length
separately.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-rw-r--r-- | libavformat/webmdashenc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/webmdashenc.c b/libavformat/webmdashenc.c index 04f8cbe39d..332d0466e1 100644 --- a/libavformat/webmdashenc.c +++ b/libavformat/webmdashenc.c @@ -133,7 +133,7 @@ static int subsegment_alignment(AVFormatContext *s, const AdaptationSet *as) for (i = 1; i < as->nb_streams; i++) { AVDictionaryEntry *ts = av_dict_get(s->streams[as->streams[i]]->metadata, CUE_TIMESTAMPS, NULL, 0); - if (!ts || strncmp(gold->value, ts->value, strlen(gold->value))) return 0; + if (!ts || !av_strstart(ts->value, gold->value, NULL)) return 0; } return 1; } @@ -152,7 +152,7 @@ static int bitstream_switching(AVFormatContext *s, const AdaptationSet *as) TRACK_NUMBER, NULL, 0); AVCodecParameters *par = st->codecpar; if (!track_num || - strncmp(gold_track_num->value, track_num->value, strlen(gold_track_num->value)) || + !av_strstart(track_num->value, gold_track_num->value, NULL) || gold_par->codec_id != par->codec_id || gold_par->extradata_size != par->extradata_size || memcmp(gold_par->extradata, par->extradata, par->extradata_size)) { |