summaryrefslogtreecommitdiff
path: root/libavformat/rtsp.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-04-03 15:02:07 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-04-20 18:21:39 +0200
commit4e254ec6be86977d9ea173f1769398f153bd1d28 (patch)
treea15b5217581e67d9096a979b8667bcffb55318e2 /libavformat/rtsp.c
parent87b056e6af0ccebc6813c54c88b5eb78ac06faf2 (diff)
avformat/rtsp: Put strings instead of pointers to strings into array
In this example, the difference in length between the shortest and longest string is three, so that not using pointers to strings saves space even on 32bit systems. Moreover, there is no need to use a sentinel here; it can be replaced with FF_ARRAY_ELEMS. Reviewed-by: Ross Nicholson <phunkyfish@gmail.com> Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r--libavformat/rtsp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 0a6462000d..b2b3f32011 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -2526,10 +2526,11 @@ static int rtp_read_header(AVFormatContext *s)
p = strchr(s->url, '?');
if (p) {
- static const char *filters[][2] = {{"sources", "incl"}, {"block", "excl"}, {NULL, NULL}};
+ static const char filters[][2][8] = { { "sources", "incl" },
+ { "block", "excl" } };
int i;
char *q;
- for (i = 0; filters[i][0]; i++) {
+ for (i = 0; i < FF_ARRAY_ELEMS(filters); i++) {
if (av_find_info_tag(filters_buf, sizeof(filters_buf), filters[i][0], p)) {
q = filters_buf;
while ((q = strchr(q, ',')) != NULL)