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
19411941 break;
19421942 }
19431943
1944− if (CONFIG_RTSP_DEMUXER && s->iformat) {
1944+#if CONFIG_RTSP_DEMUXER
1945+ if (s->iformat) {
19451946 if (rt->server_type == RTSP_SERVER_SATIP)
19461947 err = init_satip_stream(s);
19471948 else
19481949 err = ff_rtsp_setup_input_streams(s, reply);
1949− } else if (CONFIG_RTSP_MUXER)
1950+ } else
1951+#endif
1952+ if (CONFIG_RTSP_MUXER)
19501953 err = ff_rtsp_setup_output_streams(s, host);
19511954 else
19521955 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