]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/avio.c
avformat/hlsenc: allow a custom SDT and PAT period
[ffmpeg] / libavformat / avio.c
index 663789ec024264f877d6a695f17549c722731905..65cfc0f4bbcd5b591d3a6e1b34665a30f5bf2ef1 100644 (file)
@@ -26,6 +26,7 @@
 #include "libavutil/avassert.h"
 #include "os_support.h"
 #include "avformat.h"
+#include "internal.h"
 #if CONFIG_NETWORK
 #include "network.h"
 #endif
@@ -283,6 +284,9 @@ static const struct URLProtocol *url_find_protocol(const char *filename)
         }
     }
     av_freep(&protocols);
+    if (av_strstart(filename, "https:", NULL) || av_strstart(filename, "tls:", NULL))
+        av_log(NULL, AV_LOG_WARNING, "https protocol not found, recompile FFmpeg with "
+                                     "openssl, gnutls or securetransport enabled.\n");
 
     return NULL;
 }
@@ -297,10 +301,6 @@ int ffurl_alloc(URLContext **puc, const char *filename, int flags,
        return url_alloc_for_protocol(puc, p, filename, flags, int_cb);
 
     *puc = NULL;
-    if (av_strstart(filename, "https:", NULL) || av_strstart(filename, "tls:", NULL))
-        av_log(NULL, AV_LOG_WARNING, "https protocol not found, recompile FFmpeg with "
-                                     "openssl, gnutls "
-                                     "or securetransport enabled.\n");
     return AVERROR_PROTOCOL_NOT_FOUND;
 }
 
@@ -347,8 +347,7 @@ int ffurl_open_whitelist(URLContext **puc, const char *filename, int flags,
     if (!ret)
         return 0;
 fail:
-    ffurl_close(*puc);
-    *puc = NULL;
+    ffurl_closep(puc);
     return ret;
 }
 
@@ -667,3 +666,11 @@ int ff_check_interrupt(AVIOInterruptCB *cb)
         return cb->callback(cb->opaque);
     return 0;
 }
+
+int ff_rename(const char *url_src, const char *url_dst, void *logctx)
+{
+    int ret = avpriv_io_move(url_src, url_dst);
+    if (ret < 0)
+        av_log(logctx, AV_LOG_ERROR, "failed to rename file %s to %s: %s\n", url_src, url_dst, av_err2str(ret));
+    return ret;
+}