[MPlayer-dev-eng] Code to download an ASF Playlist and AMD 64 Compile fix

iorrus mcdonnagh iorrus at yahoo.co.uk
Fri Dec 21 02:44:08 CET 2007


Hi,

Thats much cleaner mine was a mess, although there seems to be a bug using just your patch as the file you gave works but  mms://ir2-c100.narrowstep.tv/mcp?psid=23504744&ref=0&chid=5&pid=494&vid=16988099&br=800&tid=1&void=25684
doesn't (it works using my patch with rc1) it could be someting to do with changes since rc1 however as asf_streaming.c seems to be quite different!


Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de> wrote: Hello,
On Thu, Dec 20, 2007 at 09:29:53PM +0000, iorrus mcdonnagh wrote:
> It currently only works if the asf stream is passed over http as I couldn't get a look at the mms bitstream using etheral or at least in a way that made sense.
> 
> I've attached the corrected diff.
> 
> It doesn't handle the end of stream correctly either mplayer just crashes this just needs to be found and sorted tho nothing too major. I simply did enough to get it working.

Attached is the absolute core part of the patch, enough to make mplayer
-dumpstream dump all parts. Further parts can by played by using the
right -sb parameter.
E.g.:
mplayer -dumpstream mmshttp://stream.onet.pl/media.wsx?/info/200512/cde5e3acbd.wmv
mplayer stream.dump -sb 203188

Greetings,
Reimar Döffinger
diff --git a/stream/asf_streaming.c b/stream/asf_streaming.c
index fc13db1..5767a0d 100644
--- a/stream/asf_streaming.c
+++ b/stream/asf_streaming.c
@@ -190,9 +190,12 @@ static int asf_streaming_parse_header(int fd, streaming_ctrl_t* streaming_ctrl)
  // The ASF header can be in several network chunks. For example if the content description
  // is big, the ASF header will be split in 2 network chunk.
  // So we need to retrieve all the chunk before starting to parse the header.
+  r = 0;
   do {
+if (r == 0)
    if (asf_read_wrapper(fd, &chunk, sizeof(ASF_stream_chunck_t), streaming_ctrl) <= 0)
      return -1;
+r = 1;
    // Endian handling of the stream chunk
    le2me_ASF_stream_chunck_t(&chunk);
    size = asf_streaming( &chunk, &r) - sizeof(ASF_stream_chunck_t);
@@ -425,6 +428,26 @@ static int asf_http_streaming_read( int fd, char *buffer, int size, streaming_ct
       // Endian handling of the stream chunk
       le2me_ASF_stream_chunck_t(&chunk);
       chunk_size = asf_streaming( &chunk, &drop_chunk );
+
+      // Playlist File Handling
+      if (chunk.type == ASF_STREAMING_CLEAR && chunk.size == 4) {
+        chunk_size = chunk.size_confirm+4;
+        le2me_ASF_stream_chunck_t(&chunk); //reversal
+        //reinserts end of chunk that contains header information into the stream
+        streaming_bufferize(streaming_ctrl,(char*)(&chunk)+(sizeof(ASF_stream_chunck_t)-4),4);
+        le2me_ASF_stream_chunck_t(&chunk); //re-reversal
+
+        //puts the header into the buffer
+        if (chunk.unknown == ASF_STREAMING_HEADER) {
+          if (asf_read_wrapper(fd, buffer, chunk_size, streaming_ctrl) <= 0)
+            return -1;
+          streaming_bufferize(streaming_ctrl,buffer,chunk_size);
+          asf_streaming_parse_header( fd, streaming_ctrl);
+          streaming_bufferize(streaming_ctrl,buffer,chunk_size);
+        }
+        continue;
+      }
+
       if(chunk_size < 0) {
  mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_ASF_ErrorParsingChunkHeader);
  return -1;
_______________________________________________
MPlayer-dev-eng mailing list
MPlayer-dev-eng at mplayerhq.hu
http://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng

       
---------------------------------
 Sent from Yahoo! &#45; a smarter inbox.


More information about the MPlayer-dev-eng mailing list