Commit 4e254ec6 authored by Andreas Rheinhardt's avatar Andreas Rheinhardt

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: 's avatarRoss Nicholson <phunkyfish@gmail.com>
Reviewed-by: 's avatarMarton Balint <cus@passwd.hu>
Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
parent 87b056e6
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment