summaryrefslogtreecommitdiff
path: root/libavformat/rtsp.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-11-01 19:40:08 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-11-01 19:40:20 +0100
commit1295377f0a9de3140330d4467347f10d03ec4169 (patch)
tree8b5b652ae983e4b56fa685a828d81b7707fa5d7e /libavformat/rtsp.c
parent04894ef32e325e33d420e15c16e3714e0f95fdb0 (diff)
parent50aef03b24d949249b020226dffa3a78077f1056 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: rtspenc: Make sure BYE packets are sent before TEARDOWN Merged-by: Michael Niedermayer <michaelni@gmx.at>
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 2abb36b4a5..3b88fc7271 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -641,7 +641,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;
@@ -656,6 +656,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 {
@@ -681,7 +683,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) {
@@ -1547,7 +1549,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;
}