[FFmpeg-soc] [soc]: r5929 - mms/mmsh.c

spyfeng subversion at mplayerhq.hu
Sat Aug 21 05:00:22 CEST 2010


Author: spyfeng
Date: Sat Aug 21 05:00:21 2010
New Revision: 5929

Log:
add empty line after header comment.
indent more one character for multiple code lines.
modify one log message.

Modified:
   mms/mmsh.c

Modified: mms/mmsh.c
==============================================================================
--- mms/mmsh.c	Fri Aug 20 17:07:38 2010	(r5928)
+++ mms/mmsh.c	Sat Aug 21 05:00:21 2010	(r5929)
@@ -24,6 +24,7 @@
  * Windows Media HTTP Streaming Protocol.
  * http://msdn.microsoft.com/en-us/library/cc251059(PROT.10).aspx
  */
+
 #include <string.h>
 #include "libavutil/intreadwrite.h"
 #include "libavutil/avstring.h"
@@ -115,7 +116,7 @@ static int read_data_packet(MMSHContext 
     int res;
     if (len > sizeof(mms->in_buffer)) {
         av_log(NULL, AV_LOG_ERROR,
-              "Data packet length %d exceeds the in_buffer size %d\n",
+               "Data packet length %d exceeds the in_buffer size %d\n",
                len, sizeof(mms->in_buffer));
         return AVERROR(EIO);
     }
@@ -127,7 +128,7 @@ static int read_data_packet(MMSHContext 
     }
     if (len > mms->asf_packet_len) {
         av_log(NULL, AV_LOG_ERROR,
-              "Chunk length %d exceed packet length %d\n",len, mms->asf_packet_len);
+               "Chunk length %d exceed packet length %d\n",len, mms->asf_packet_len);
         return AVERROR_INVALIDDATA;
     } else {
         memset(mms->in_buffer + len, 0, mms->asf_packet_len - len); // padding
@@ -167,14 +168,14 @@ static int get_http_header_data(MMSHCont
             }
             if (len > mms->asf_header_size) {
                 av_log(NULL, AV_LOG_ERROR,
-                      "Asf header packet len = %d exceed the asf header buf size %d\n",
+                       "Asf header packet len = %d exceed the asf header buf size %d\n",
                        len, mms->asf_header_size);
                 return AVERROR(EIO);
             }
             res = url_read_complete(mms->mms_hd, mms->asf_header, len);
             if (res != len) {
                 av_log(NULL, AV_LOG_ERROR,
-                      "Recv asf header data len %d != expected len %d\n", res, len);
+                       "Recv asf header data len %d != expected len %d\n", res, len);
                 return AVERROR(EIO);
             }
             mms->asf_header_size = len;
@@ -190,7 +191,7 @@ static int get_http_header_data(MMSHCont
             if (len) {
                 if (len > sizeof(mms->in_buffer)) {
                     av_log(NULL, AV_LOG_ERROR,
-                          "Other packet len = %d exceed the in_buffer size %d\n",
+                           "Other packet len = %d exceed the in_buffer size %d\n",
                            len, sizeof(mms->in_buffer));
                     return AVERROR(EIO);
                 }
@@ -235,13 +236,13 @@ static int mmsh_open(URLContext *h, cons
     }
 
     snprintf(headers, sizeof(headers),
-            "Accept: */*\r\n"
+             "Accept: */*\r\n"
              USERAGENT
-            "Host: %s:%d\r\n"
-            "Pragma: no-cache,rate=1.000000,stream-time=0,"
-            "stream-offset=0:0,request-context=%u,max-duration=0\r\n"
+             "Host: %s:%d\r\n"
+             "Pragma: no-cache,rate=1.000000,stream-time=0,"
+             "stream-offset=0:0,request-context=%u,max-duration=0\r\n"
              CLIENTGUID
-            "Connection: Close\r\n\r\n",
+             "Connection: Close\r\n\r\n",
              host, port, mmsh->request_seq++);
     ff_http_set_headers(mms->mms_hd, headers);
 
@@ -273,15 +274,15 @@ static int mmsh_open(URLContext *h, cons
     }
     // send play request
     err = snprintf(headers, sizeof(headers),
-                  "Accept: */*\r\n"
+                   "Accept: */*\r\n"
                    USERAGENT
-                  "Host: %s:%d\r\n"
-                  "Pragma: no-cache,rate=1.000000,request-context=%u\r\n"
-                  "Pragma: xPlayStrm=1\r\n"
+                   "Host: %s:%d\r\n"
+                   "Pragma: no-cache,rate=1.000000,request-context=%u\r\n"
+                   "Pragma: xPlayStrm=1\r\n"
                    CLIENTGUID
-                  "Pragma: stream-switch-count=%d\r\n"
-                  "Pragma: stream-switch-entry=%s\r\n"
-                  "Connection: Close\r\n\r\n",
+                   "Pragma: stream-switch-count=%d\r\n"
+                   "Pragma: stream-switch-entry=%s\r\n"
+                   "Connection: Close\r\n\r\n",
                    host, port, mmsh->request_seq++, mms->stream_num, stream_selection);
     av_freep(&stream_selection);
     if (err < 0) {
@@ -325,8 +326,8 @@ static int handle_chunk_type(MMSHContext
         return AVERROR(EIO);
     case CHUNK_TYPE_STREAM_CHANGE:
         mms->header_parsed = 0;
-        if ((res = get_http_header_data(mmsh)) != 0) {
-            av_log(NULL, AV_LOG_ERROR,"Stream changed! get new header failed!\n");
+        if (res = get_http_header_data(mmsh)) {
+            av_log(NULL, AV_LOG_ERROR,"Stream changed! Failed to get new header!\n");
             return res;
         }
         break;


More information about the FFmpeg-soc mailing list