]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/mmst.c
rtsp: make ff_sdp_parse return value forwarded
[ffmpeg] / libavformat / mmst.c
index e4aea48f985b31485fd4fbf85f90e8d60d680768..d3417d1659df5e8e330457a5e2318f0855ee8fa0 100644 (file)
@@ -34,7 +34,6 @@
 #include "libavutil/intreadwrite.h"
 #include "libavcodec/bytestream.h"
 #include "network.h"
-#include "asf.h"
 
 #define LOCAL_ADDRESS 0xc0a80081    // FIXME get and use correct local ip address.
 #define LOCAL_PORT    1037          // as above.
@@ -159,14 +158,14 @@ static void mms_put_utf16(MMSContext *mms, uint8_t *src)
     init_put_byte(&bic, mms->write_out_ptr,
             sizeof(mms->out_buffer) - size, 1, NULL, NULL, NULL, NULL);
 
-    len = ff_put_str16_nolen(&bic, src);
+    len = avio_put_str16le(&bic, src);
     mms->write_out_ptr += len;
 }
 
 static int send_time_test_data(MMSTContext *mmst)
 {
     start_command_packet(mmst, CS_PKT_TIMING_DATA_REQUEST);
-    insert_command_prefixes(&mmst->mms, 0xf0f0f0f1, 0x0004000b);
+    insert_command_prefixes(&mmst->mms, 0x00f0f0f0, 0x0004000b);
     return send_command_packet(mmst);
 }
 
@@ -468,6 +467,7 @@ static int mms_close(URLContext *h)
     }
 
     /* free all separately allocated pointers in mms */
+    av_free(mms->streams);
     av_free(mms->asf_header);
     av_freep(&h->priv_data);
 
@@ -546,8 +546,12 @@ static int mms_open(URLContext *h, const char *uri, int flags)
     err = mms_safe_send_recv(mmst, NULL, SC_PKT_ASF_HEADER);
     if (err)
         goto fail;
-    if((mmst->incoming_flags != 0X08) && (mmst->incoming_flags != 0X0C))
+    if((mmst->incoming_flags != 0X08) && (mmst->incoming_flags != 0X0C)) {
+        av_log(NULL, AV_LOG_ERROR,
+               "The server does not support MMST (try MMSH or RTSP)\n");
+        err = AVERROR_NOFMT;
         goto fail;
+    }
     err = ff_mms_asf_header_parser(mms);
     if (err) {
         dprintf(NULL, "asf header parsed failed!\n");
@@ -617,7 +621,7 @@ static int mms_read(URLContext *h, uint8_t *buf, int size)
     return result;
 }
 
-URLProtocol mmst_protocol = {
+URLProtocol ff_mmst_protocol = {
     "mmst",
     mms_open,
     mms_read,