[MPlayer-dev-eng] Re: [PATCH] endian fixes for ASF streaming
Guillaume Morin
guillaume at morinfr.org
Sun Apr 14 03:01:50 CEST 2002
Arpi,
Thanks to have applied the asfheader.c patch. However, I'd like to know
why you have not applied the asf_streaming.c patch. I've just tested the
code without it, it does not work :
=====> ASF Live stream
=====> Unknown stream type 0x2448
Don't got a header as first chunk !!!!
===> ASF/HTTP failed
(stream type is indeed 0x4824).
Did you just forget it or was it deliberate ? If this is the latter,
could you explain where I am mistaken.
TIA.
Dans un message du 13 avr à 18:16, Guillaume Morin écrivait :
> --- asfheader.c.old Sat Apr 13 17:42:50 2002
> +++ asfheader.c Sat Apr 13 17:49:11 2002
> @@ -293,6 +293,17 @@
> stream_read( demuxer->stream, object, objh.size );
> // FIXME: We need some endian handling below...
> ptr = object;
> +#if WORDS_BIGENDIAN
> + *(uint16_t*)ptr = bswap_16(*(uint16_t*)ptr);
> + ptr += 2;
> + for (i = 2 ; i < objh.size ; i += 6) {
> + *(uint16_t*)ptr = bswap_16(*(uint16_t*)ptr);
> + ptr += 2;
> + *(uint32_t*)ptr = bswap_32(*(uint32_t*)ptr);
> + ptr += 4;
> + }
> + ptr = object;
> +#endif
> stream_count = *(uint16_t*)ptr;
> ptr += sizeof(uint16_t);
> if(stream_count > 0)
> --- asf_streaming.c.old Sat Apr 13 15:14:58 2002
> +++ asf_streaming.c Sat Apr 13 18:04:06 2002
> @@ -85,6 +85,13 @@
> */
> if( drop_packet!=NULL ) *drop_packet = 0;
>
> +#if WORDS_BIGENDIAN
> + stream_chunck->size = bswap_16(stream_chunck->size);
> + stream_chunck->type = bswap_16(stream_chunck->type);
> + stream_chunck->unknown = bswap_16(stream_chunck->unknown);
> + stream_chunck->size_confirm = bswap_16(stream_chunck->size_confirm);
> + stream_chunck->sequence_number = bswap_32(stream_chunck->sequence_number);
> +#endif
> if( stream_chunck->size<8 ) {
> printf("Ahhhh, stream_chunck size is too small: %d\n", stream_chunck->size);
> return -1;
>
> PS: if you answer this message, please keep me CC'ed.
>
> --
> Guillaume Morin <guillaume at morinfr.org>
>
> Oh, that is nice out there, I think I'll stay for a while (RHCP)
>
--
Guillaume Morin <guillaume at morinfr.org>
Unwisely, Santa offered a teddy bear to James, unaware that he had
been mauled by a grizzly earlier that year (T. Burton)
More information about the MPlayer-dev-eng
mailing list