summaryrefslogtreecommitdiff
path: root/libavformat/rtsp.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-10-30 19:12:45 +0200
committerMartin Storsjö <martin@martin.st>2013-11-01 09:57:06 +0200
commit50aef03b24d949249b020226dffa3a78077f1056 (patch)
tree99f576b21f7c68ff57ef8d6c717b567306bdc86d /libavformat/rtsp.c
parent9ceed7af377cea6a430d63a2f5d5cf1afe0d4f05 (diff)
rtspenc: Make sure BYE packets are sent before TEARDOWN
Also make sure the BYE packets are sent at all when using TCP interleaved transport. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r--libavformat/rtsp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 16b5d416f2..70f8e2104e 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -638,7 +638,7 @@ int ff_sdp_parse(AVFormatContext *s, const char *content)
}
#endif /* CONFIG_RTPDEC */
-void ff_rtsp_undo_setup(AVFormatContext *s)
+void ff_rtsp_undo_setup(AVFormatContext *s, int send_packets)
{
RTSPState *rt = s->priv_data;
int i;
@@ -653,6 +653,8 @@ void ff_rtsp_undo_setup(AVFormatContext *s)
av_write_trailer(rtpctx);
if (rt->lower_transport == RTSP_LOWER_TRANSPORT_TCP) {
uint8_t *ptr;
+ if (CONFIG_RTSP_MUXER && rtpctx->pb && send_packets)
+ ff_rtsp_tcp_write_packet(s, rtsp_st);
avio_close_dyn_buf(rtpctx->pb, &ptr);
av_free(ptr);
} else {
@@ -678,7 +680,7 @@ void ff_rtsp_close_streams(AVFormatContext *s)
int i, j;
RTSPStream *rtsp_st;
- ff_rtsp_undo_setup(s);
+ ff_rtsp_undo_setup(s, 0);
for (i = 0; i < rt->nb_rtsp_streams; i++) {
rtsp_st = rt->rtsp_streams[i];
if (rtsp_st) {
@@ -1549,7 +1551,7 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
return 0;
fail:
- ff_rtsp_undo_setup(s);
+ ff_rtsp_undo_setup(s, 0);
return err;
}