History

avformat/rtsp: Fix build failure when RTP demuxers are disabled

rtsp.c uses a check of the form "if (CONFIG_RTSP_DEMUXER && ...) {}" with the intent to make the code compilable even though the part guarded by this check contains calls to functions that don't exist when the RTSP demuxer is disabled. Yet even then compilers still need a declaration of all the functions in the dead code block and error out if not (due to our usage of -Werror=implicit-function-declaration) and no such declaration exists for a static function in rtsp.c. Simply adding a declaration leads to a "used but never defined" warning, therefore this commit resorts to an #if.

Andreas Rheinhardt committed 5 years ago

Commit e9513051 parent 7936cfc1 file · +5 −2Browse files

Unified · Split

libavformat/rtsp.c+5−2
@@ -1941,12 +1941,15 @@ redirect: · 1940 unmodified lines
1941 break;1941 break;
1942 }1942 }
1943 1943
1944 if (CONFIG_RTSP_DEMUXER && s->iformat) {1944#if CONFIG_RTSP_DEMUXER
1945 if (s->iformat) {
1945 if (rt->server_type == RTSP_SERVER_SATIP)1946 if (rt->server_type == RTSP_SERVER_SATIP)
1946 err = init_satip_stream(s);1947 err = init_satip_stream(s);
1947 else1948 else
1948 err = ff_rtsp_setup_input_streams(s, reply);1949 err = ff_rtsp_setup_input_streams(s, reply);
1949 } else if (CONFIG_RTSP_MUXER)1950 } else
1951#endif
1952 if (CONFIG_RTSP_MUXER)
1950 err = ff_rtsp_setup_output_streams(s, host);1953 err = ff_rtsp_setup_output_streams(s, host);
1951 else1954 else
1952 av_assert0(0);1955 av_assert0(0);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t