summaryrefslogtreecommitdiff
path: root/libavformat/rtsp.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r--libavformat/rtsp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index c079fb6293..72de537956 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -612,6 +612,7 @@ void ff_rtsp_close_streams(AVFormatContext *s)
static void *rtsp_rtp_mux_open(AVFormatContext *s, AVStream *st,
URLContext *handle)
{
+ RTSPState *rt = s->priv_data;
AVFormatContext *rtpctx;
int ret;
AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL);
@@ -634,6 +635,9 @@ static void *rtsp_rtp_mux_open(AVFormatContext *s, AVStream *st,
/* Copy other stream parameters. */
rtpctx->streams[0]->sample_aspect_ratio = st->sample_aspect_ratio;
+ /* Set the synchronized start time. */
+ rtpctx->start_time_realtime = rt->start_time;
+
/* Remove the local codec, link to the original codec
* context instead, to give the rtp muxer access to
* codec parameters. */
@@ -1340,6 +1344,8 @@ static int rtsp_setup_output_streams(AVFormatContext *s, const char *addr)
char *sdp;
AVFormatContext sdp_ctx, *ctx_array[1];
+ rt->start_time = av_gettime();
+
/* Announce the stream */
snprintf(cmd, sizeof(cmd),
"ANNOUNCE %s RTSP/1.0\r\n"