[FFmpeg-soc] [soc]: r5807 - mms/mmst.c
spyfeng
subversion at mplayerhq.hu
Thu May 20 18:48:30 CEST 2010
Author: spyfeng
Date: Thu May 20 18:48:30 2010
New Revision: 5807
Log:
add preprocess code lines in get_tcp_server_response().
Modified:
mms/mmst.c
Modified: mms/mmst.c
==============================================================================
--- mms/mmst.c Thu May 20 18:19:09 2010 (r5806)
+++ mms/mmst.c Thu May 20 18:48:30 2010 (r5807)
@@ -330,6 +330,16 @@ static MMSSCPacketType get_tcp_server_re
}
}
}
+
+ // preprocess some packet type
+ if(packet_type == SC_PKT_KEEPALIVE) {
+ send_keepalive_packet(mms);
+ continue;
+ } else if(packet_type == SC_PKT_STREAM_CHANGING) {
+ handle_packet_stream_changing_type(mms);
+ } else if(packet_type == SC_PKT_ASF_MEDIA) {
+ pad_media_packet(mms);
+ }
return packet_type;
} else {
if(read_result<0) {
@@ -342,7 +352,6 @@ static MMSSCPacketType get_tcp_server_re
return packet_type;
}
}
- return packet_type;
}
static int mms_safe_send_recv(MMSContext *mms,
@@ -358,23 +367,10 @@ static int mms_safe_send_recv(MMSContext
}
}
-recv_again:
- type = get_tcp_server_response(mms);
- if (type != expect_type) {
- if (type == SC_PKT_KEEPALIVE) {
- send_keepalive_packet(mms);
- goto recv_again;
- } else if (type == SC_PKT_STREAM_CHANGING) {
- handle_packet_stream_changing_type(mms);
- //TODO: Handle new header when change the stream type.
- return -1;
- } else {
- dprintf(NULL,"Unhandled packet type %d\n", type);
- return -1;
- }
+ if ((type = get_tcp_server_response(mms)) != expect_type) {
+ dprintf(NULL,"Unexpected packet type %d with type %d\n", type, expect_type);
+ return -1;
} else {
- if (type == SC_PKT_ASF_MEDIA)
- pad_media_packet(mms);
return 0;
}
}
More information about the FFmpeg-soc
mailing list