diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 6310d79..5421bb2 100644
|
a
|
b
|
|
| 62 | 62 | #define DEC AV_OPT_FLAG_DECODING_PARAM |
| 63 | 63 | #define ENC AV_OPT_FLAG_ENCODING_PARAM |
| 64 | 64 | |
| | 65 | #define DEFAULT_USER_AGENT "Lavf/" AV_STRINGIFY(LIBAVFORMAT_VERSION) |
| | 66 | |
| 65 | 67 | #define RTSP_FLAG_OPTS(name, longname) \ |
| 66 | 68 | { name, longname, OFFSET(rtsp_flags), AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX, DEC, "rtsp_flags" }, \ |
| 67 | 69 | { "filter_src", "Only receive packets from the negotiated peer IP", 0, AV_OPT_TYPE_CONST, {.i64 = RTSP_FLAG_FILTER_SRC}, 0, 0, DEC, "rtsp_flags" }, \ |
| … |
… |
const AVOption ff_rtsp_options[] = {
|
| 91 | 93 | { "timeout", "Maximum timeout (in seconds) to wait for incoming connections. -1 is infinite. Implies flag listen", OFFSET(initial_timeout), AV_OPT_TYPE_INT, {.i64 = -1}, INT_MIN, INT_MAX, DEC }, |
| 92 | 94 | { "stimeout", "timeout (in micro seconds) of socket i/o operations.", OFFSET(stimeout), AV_OPT_TYPE_INT, {.i64 = 0}, INT_MIN, INT_MAX, DEC }, |
| 93 | 95 | RTSP_REORDERING_OPTS(), |
| | 96 | { "user-agent", "override User-Agent header", OFFSET(user_agent), AV_OPT_TYPE_STRING, {.str = DEFAULT_USER_AGENT}, 0, 0, DEC }, |
| 94 | 97 | { NULL }, |
| 95 | 98 | }; |
| 96 | 99 | |
diff --git a/libavformat/rtsp.h b/libavformat/rtsp.h
index 4af3507..9e6e237 100644
|
a
|
b
|
typedef struct RTSPState {
|
| 399 | 399 | * Size of RTP packet reordering queue. |
| 400 | 400 | */ |
| 401 | 401 | int reordering_queue_size; |
| | 402 | |
| | 403 | /** |
| | 404 | * User-Agent string |
| | 405 | */ |
| | 406 | char *user_agent; |
| 402 | 407 | } RTSPState; |
| 403 | 408 | |
| 404 | 409 | #define RTSP_FLAG_FILTER_SRC 0x1 /**< Filter incoming UDP packets - |
diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
index da571a8..99a21cd 100644
|
a
|
b
|
int ff_rtsp_setup_input_streams(AVFormatContext *s, RTSPMessageHeader *reply)
|
| 574 | 574 | /* describe the stream */ |
| 575 | 575 | snprintf(cmd, sizeof(cmd), |
| 576 | 576 | "Accept: application/sdp\r\n"); |
| | 577 | av_strlcatf(cmd, sizeof(cmd), |
| | 578 | "User-Agent: %s\r\n", rt->user_agent); |
| 577 | 579 | if (rt->server_type == RTSP_SERVER_REAL) { |
| 578 | 580 | /** |
| 579 | 581 | * The Require: attribute is needed for proper streaming from |