]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rtspdec.c
tls: Handle connection via a http proxy
[ffmpeg] / libavformat / rtspdec.c
index 9cd9be1d4bb6349a4ebe9504e833267f40d087b4..1b4982f2122484d3a1d567f74ce7bb9f4bd6c13b 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "libavutil/avstring.h"
 #include "libavutil/intreadwrite.h"
-#include "libavutil/opt.h"
+#include "libavutil/mathematics.h"
 #include "avformat.h"
 
 #include "internal.h"
@@ -52,6 +52,8 @@ static int rtsp_read_play(AVFormatContext *s)
                 rtpctx->last_rtcp_ntp_time  = AV_NOPTS_VALUE;
                 rtpctx->first_rtcp_ntp_time = AV_NOPTS_VALUE;
                 rtpctx->base_timestamp      = 0;
+                rtpctx->timestamp           = 0;
+                rtpctx->unwrapped_timestamp = 0;
                 rtpctx->rtcp_ts_offset      = 0;
             }
         }
@@ -163,11 +165,6 @@ static int rtsp_read_header(AVFormatContext *s,
         return AVERROR(ENOMEM);
     rt->real_setup = rt->real_setup_cache + s->nb_streams;
 
-#if FF_API_FORMAT_PARAMETERS
-    if (ap->initial_pause)
-        rt->initial_pause = ap->initial_pause;
-#endif
-
     if (rt->initial_pause) {
          /* do not start immediately */
     } else {
@@ -382,12 +379,6 @@ static int rtsp_read_close(AVFormatContext *s)
 {
     RTSPState *rt = s->priv_data;
 
-#if 0
-    /* NOTE: it is valid to flush the buffer here */
-    if (rt->lower_transport == RTSP_LOWER_TRANSPORT_TCP) {
-        avio_close(&rt->rtsp_gb);
-    }
-#endif
     ff_rtsp_send_cmd_async(s, "TEARDOWN", rt->control_uri, NULL);
 
     ff_rtsp_close_streams(s);
@@ -398,27 +389,22 @@ static int rtsp_read_close(AVFormatContext *s)
     return 0;
 }
 
-static const AVOption options[] = {
-    { "initial_pause",  "Don't start playing the stream immediately", offsetof(RTSPState, initial_pause),  FF_OPT_TYPE_INT, {.dbl = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
-    { NULL },
-};
-
 const AVClass rtsp_demuxer_class = {
     .class_name     = "RTSP demuxer",
     .item_name      = av_default_item_name,
-    .option         = options,
+    .option         = ff_rtsp_options,
     .version        = LIBAVUTIL_VERSION_INT,
 };
 
 AVInputFormat ff_rtsp_demuxer = {
-    "rtsp",
-    NULL_IF_CONFIG_SMALL("RTSP input format"),
-    sizeof(RTSPState),
-    rtsp_probe,
-    rtsp_read_header,
-    rtsp_read_packet,
-    rtsp_read_close,
-    rtsp_read_seek,
+    .name           = "rtsp",
+    .long_name      = NULL_IF_CONFIG_SMALL("RTSP input format"),
+    .priv_data_size = sizeof(RTSPState),
+    .read_probe     = rtsp_probe,
+    .read_header    = rtsp_read_header,
+    .read_packet    = rtsp_read_packet,
+    .read_close     = rtsp_read_close,
+    .read_seek      = rtsp_read_seek,
     .flags = AVFMT_NOFILE,
     .read_play = rtsp_read_play,
     .read_pause = rtsp_read_pause,