Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#9065 closed defect (fixed)

avformat_open_input doesn't handle HTTP status code 308

Reported by: rbcbw Owned by:
Priority: normal Component: avformat
Version: unspecified Keywords: http
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by Carl Eugen Hoyos)

Summary of the bug:

When using avformat_open_input to stream an mp3 such as a podcast, it does not handle a 308 Permanent Redirect HTTP status code.
This has been more recently defined in https://tools.ietf.org/html/rfc7538

This can (currently) be seen with, for example, http://www.podtrac.com/pts/redirect.mp3/pdst.fm/e/chtbl.com/track/5899E/traffic.megaphone.fm/HSW1892445597.mp3

I did submit a patch for this to the FFmpeg-devel list - which I don't think has been picked up: http://ffmpeg.org/pipermail/ffmpeg-devel/2021-January/274625.html

The patch is:

 libavformat/http.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/http.c b/libavformat/http.c
index 6c39da1a8b..6d995877d2 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -292,7 +292,7 @@ redo:
             goto fail;
     }
     if ((s->http_code == 301 || s->http_code == 302 ||
-         s->http_code == 303 || s->http_code == 307) &&
+         s->http_code == 303 || s->http_code == 307 || s->http_code == 308) &&
         location_changed == 1) {
         /* url moved, get next */
         ffurl_closep(&s->hd);

Change History (2)

comment:1 by Marton Balint, 3 years ago

Resolution: fixed
Status: newclosed

comment:2 by Carl Eugen Hoyos, 3 years ago

Description: modified (diff)
Keywords: http added
Note: See TracTickets for help on using tickets.