[FFmpeg-soc] [soc]: r5760 - mms/mmst.c

spyfeng subversion at mplayerhq.hu
Mon Apr 19 17:50:24 CEST 2010


Author: spyfeng
Date: Mon Apr 19 17:50:24 2010
New Revision: 5760

Log:
return result directly in funtion read_data().

Modified:
   mms/mmst.c

Modified: mms/mmst.c
==============================================================================
--- mms/mmst.c	Mon Apr 19 17:40:35 2010	(r5759)
+++ mms/mmst.c	Mon Apr 19 17:50:24 2010	(r5760)
@@ -455,14 +455,14 @@ static int send_stream_selection_request
     return send_command_packet(mms);
 }
 
-static void read_data(MMSContext *mms, uint8_t *buf, const int buf_size, int* result)
+static int read_data(MMSContext *mms, uint8_t *buf, const int buf_size)
 {
     int read_size;
     read_size = FFMIN(buf_size, mms->pkt_buf_len);
     memcpy(buf, mms->pkt_read_ptr, read_size);
     mms->pkt_buf_len -= read_size;
     mms->pkt_read_ptr+= read_size;
-    *result += read_size;
+    return read_size;
 }
 
 /** Read at most one media packet (or a whole header). */
@@ -485,7 +485,7 @@ static int read_mms_packet(MMSContext *m
             av_freep(&mms->asf_header);
         } else if(mms->pkt_buf_len) {
             /* Read from media packet buffer */
-            read_data(mms, buf, buf_size, &result);
+            result = read_data(mms, buf, buf_size);
         } else {
             /* Read from network */
             packet_type= get_tcp_server_response(mms);
@@ -497,7 +497,7 @@ static int read_mms_packet(MMSContext *m
                     result= AVERROR_IO;
                 } else {
                     // copy the data to the packet buffer.
-                    read_data(mms, buf, buf_size, &result);
+                    result = read_data(mms, buf, buf_size);
                 }
             } else {
                 dprintf(NULL, "Got a unkown Packet Type: 0x%x\n", packet_type);


More information about the FFmpeg-soc mailing list