summaryrefslogtreecommitdiffstats
path: root/libmpdemux/asf_streaming.c
diff options
context:
space:
mode:
authorbertrand <bertrand@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-04-14 05:51:32 +0000
committerbertrand <bertrand@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-04-14 05:51:32 +0000
commit956439594b0dd49b945431e2c2058a8ed7879262 (patch)
treeffc1c1cb4ee54c01461e992efa9b7d2e10503e9f /libmpdemux/asf_streaming.c
parentb6442cfc4588e0f26e69584f940b0c4e65a4fe49 (diff)
downloadmpv-956439594b0dd49b945431e2c2058a8ed7879262.tar.bz2
mpv-956439594b0dd49b945431e2c2058a8ed7879262.tar.xz
Added big endian handling for the ASF_chunk_t struct.
(reworked of the patch from Guillaume Morin <guillaume@morinfr.org>) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5618 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/asf_streaming.c')
-rw-r--r--libmpdemux/asf_streaming.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/libmpdemux/asf_streaming.c b/libmpdemux/asf_streaming.c
index 0e53e50e37..f589c776d5 100644
--- a/libmpdemux/asf_streaming.c
+++ b/libmpdemux/asf_streaming.c
@@ -101,20 +101,20 @@ printf("0x%02X\n", stream_chunck->type );
printf(" size_confirm: 0x%02X\n", stream_chunck->size_confirm );
*/
switch(stream_chunck->type) {
- case 0x4324: // $C Clear ASF configuration
+ case ASF_STREAMING_CLEAR: // $C Clear ASF configuration
printf("=====> Clearing ASF stream configuration!\n");
if( drop_packet!=NULL ) *drop_packet = 1;
return stream_chunck->size;
break;
- case 0x4424: // $D Data follows
+ case ASF_STREAMING_DATA: // $D Data follows
// printf("=====> Data follows\n");
break;
- case 0x4524: // $E Transfer complete
+ case ASF_STREAMING_END_TRANS: // $E Transfer complete
printf("=====> Transfer complete\n");
if( drop_packet!=NULL ) *drop_packet = 1;
return stream_chunck->size;
break;
- case 0x4824: // $H ASF header chunk follows
+ case ASF_STREAMING_HEADER: // $H ASF header chunk follows
printf("=====> ASF header chunk follows\n");
break;
default:
@@ -147,13 +147,15 @@ asf_streaming_parse_header(int fd, streaming_ctrl_t* streaming_ctrl) {
if(i <= 0) return -1;
r += i;
}
+ // Endian handling of the stream chunk
+ le2me_ASF_stream_chunck_t(&chunk);
size = asf_streaming( &chunk, &r) - sizeof(ASF_stream_chunck_t);
if(r) printf("Warning : drop header ????\n");
if(size < 0){
printf("Error while parsing chunk header\n");
return -1;
}
- if (chunk.type != 0x4824) {
+ if (chunk.type != ASF_STREAMING_HEADER) {
printf("Don't got a header as first chunk !!!!\n");
return -1;
}
@@ -283,6 +285,9 @@ asf_http_streaming_read( int fd, char *buffer, int size, streaming_ctrl_t *strea
}
read += r;
}
+
+ // Endian handling of the stream chunk
+ le2me_ASF_stream_chunck_t(&chunk);
chunk_size = asf_streaming( &chunk, &drop_chunk );
if(chunk_size < 0) {
printf("Error while parsing chunk header\n");
@@ -290,7 +295,7 @@ asf_http_streaming_read( int fd, char *buffer, int size, streaming_ctrl_t *strea
}
chunk_size -= sizeof(ASF_stream_chunck_t);
- if(chunk.type != 0x4824 && (!drop_chunk)) {
+ if(chunk.type != ASF_STREAMING_HEADER && (!drop_chunk)) {
if (asf_http_ctrl->packet_size < chunk_size) {
printf("Error chunk_size > packet_size\n");
return -1;