diff mbox series

[FFmpeg-devel,v3,2/2] avformat/rtsp: fix parse_rtsp_message

Message ID tencent_0557199C48E0EA5A4434A1808434213ED709@qq.com
State Accepted
Headers show
Series [FFmpeg-devel,v3,1/2] avformat/rtsp: fix infinite loop with udp transport | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Zhao Zhili Sept. 27, 2020, 11:50 a.m. UTC
1. Remove the assumption that the message method is TEARDOWN.
2. Don't ignore the error code of ff_rtsp_parse_streaming_commands.
---
 libavformat/rtsp.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Martin Storsjö Sept. 30, 2020, 9:42 a.m. UTC | #1
On Sun, 27 Sep 2020, Zhao Zhili wrote:

> 1. Remove the assumption that the message method is TEARDOWN.
> 2. Don't ignore the error code of ff_rtsp_parse_streaming_commands.
> ---
> libavformat/rtsp.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
> index 597413803f..3e69ab7287 100644
> --- a/libavformat/rtsp.c
> +++ b/libavformat/rtsp.c
> @@ -1964,11 +1964,7 @@ static int parse_rtsp_message(AVFormatContext *s)
>
>     if (rt->rtsp_flags & RTSP_FLAG_LISTEN) {
>         if (rt->state == RTSP_STATE_STREAMING) {
> -            if (!ff_rtsp_parse_streaming_commands(s))
> -                return AVERROR_EOF;
> -            else
> -                av_log(s, AV_LOG_WARNING,
> -                       "Unable to answer to TEARDOWN\n");
> +            return ff_rtsp_parse_streaming_commands(s);
>         } else
>             return 0;
>     } else {
> -- 
> 2.17.1

This looks ok to me.

// Martin
diff mbox series

Patch

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 597413803f..3e69ab7287 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1964,11 +1964,7 @@  static int parse_rtsp_message(AVFormatContext *s)
 
     if (rt->rtsp_flags & RTSP_FLAG_LISTEN) {
         if (rt->state == RTSP_STATE_STREAMING) {
-            if (!ff_rtsp_parse_streaming_commands(s))
-                return AVERROR_EOF;
-            else
-                av_log(s, AV_LOG_WARNING,
-                       "Unable to answer to TEARDOWN\n");
+            return ff_rtsp_parse_streaming_commands(s);
         } else
             return 0;
     } else {