[FFmpeg-cvslog] r24358 - trunk/libavformat/mmst.c

rbultje subversion
Tue Jul 20 17:01:06 CEST 2010


Author: rbultje
Date: Tue Jul 20 17:01:06 2010
New Revision: 24358

Log:
Check the status code of each server responses, and fail if it indicates
a problem.

Patch by Zhentan Feng <spyfeng gmail com>.

Modified:
   trunk/libavformat/mmst.c

Modified: trunk/libavformat/mmst.c
==============================================================================
--- trunk/libavformat/mmst.c	Tue Jul 20 16:59:23 2010	(r24357)
+++ trunk/libavformat/mmst.c	Tue Jul 20 17:01:06 2010	(r24358)
@@ -260,6 +260,7 @@ static MMSSCPacketType get_tcp_server_re
                 read_result= url_read_complete(mms->mms_hd, mms->in_buffer+8, 4);
                 if(read_result == 4) {
                     int length_remaining= AV_RL32(mms->in_buffer+8) + 4;
+                    int hr;
 
                     dprintf(NULL, "Length remaining is %d\n", length_remaining);
                     // read the rest of the packet.
@@ -277,6 +278,11 @@ static MMSSCPacketType get_tcp_server_re
                         dprintf(NULL, "read for packet type failed%d!\n", read_result);
                         return -1;
                     }
+                    hr = AV_RL32(mms->in_buffer + 40);
+                    if (hr) {
+                        dprintf(NULL, "The server side send back error code:0x%x\n", hr);
+                        return -1;
+                    }
                 } else {
                     dprintf(NULL, "read for length remaining failed%d!\n", read_result);
                     return -1;



More information about the ffmpeg-cvslog mailing list