]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/applehttpproto.c
matroskaenc: make sure we don't produce invalid file with no codec ID
[ffmpeg] / libavformat / applehttpproto.c
index 8a9bcb1ade5d300877e4b49dc06801e971fae16c..85f3cfcef43761b2cd932068d296a876e5adbd22 100644 (file)
@@ -25,7 +25,6 @@
  * http://tools.ietf.org/html/draft-pantos-http-live-streaming
  */
 
-#define _XOPEN_SOURCE 600
 #include "libavutil/avstring.h"
 #include "avformat.h"
 #include "internal.h"
@@ -195,7 +194,7 @@ static int applehttp_open(URLContext *h, const char *uri, int flags)
         av_strlcpy(s->playlisturl, "http://", sizeof(s->playlisturl));
         av_strlcat(s->playlisturl, nested_url, sizeof(s->playlisturl));
     } else {
-        av_log(NULL, AV_LOG_ERROR, "Unsupported url %s\n", uri);
+        av_log(h, AV_LOG_ERROR, "Unsupported url %s\n", uri);
         ret = AVERROR(EINVAL);
         goto fail;
     }
@@ -218,7 +217,7 @@ static int applehttp_open(URLContext *h, const char *uri, int flags)
     }
 
     if (s->n_segments == 0) {
-        av_log(NULL, AV_LOG_WARNING, "Empty playlist\n");
+        av_log(h, AV_LOG_WARNING, "Empty playlist\n");
         ret = AVERROR(EIO);
         goto fail;
     }
@@ -258,7 +257,7 @@ retry:
                 return ret;
     }
     if (s->cur_seq_no < s->start_seq_no) {
-        av_log(NULL, AV_LOG_WARNING,
+        av_log(h, AV_LOG_WARNING,
                "skipping %d segments ahead, expired from playlist\n",
                s->start_seq_no - s->cur_seq_no);
         s->cur_seq_no = s->start_seq_no;
@@ -274,12 +273,12 @@ retry:
         goto retry;
     }
     url = s->segments[s->cur_seq_no - s->start_seq_no]->url,
-    av_log(NULL, AV_LOG_DEBUG, "opening %s\n", url);
+    av_log(h, AV_LOG_DEBUG, "opening %s\n", url);
     ret = ffurl_open(&s->seg_hd, url, AVIO_FLAG_READ);
     if (ret < 0) {
         if (url_interrupt_cb())
             return AVERROR_EXIT;
-        av_log(NULL, AV_LOG_WARNING, "Unable to open %s\n", url);
+        av_log(h, AV_LOG_WARNING, "Unable to open %s\n", url);
         s->cur_seq_no++;
         goto retry;
     }