]> git.sesse.net Git - vlc/commitdiff
* fixed seek flag with broadcasted data.
authorLaurent Aimar <fenrir@videolan.org>
Sun, 2 Mar 2003 18:17:58 +0000 (18:17 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Sun, 2 Mar 2003 18:17:58 +0000 (18:17 +0000)
modules/access/mms/asf.h
modules/access/mms/mms.c

index d13b240798d8fa16a6cf9d534d3d9228d02aa63d..a90788b8675578c02cbcc3f5b7c325d96cc83a81 100644 (file)
@@ -2,7 +2,7 @@
  * asf.h: MMS access plug-in
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: asf.h,v 1.3 2002/11/22 18:35:57 sam Exp $
+ * $Id: asf.h,v 1.4 2003/03/02 18:17:58 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -10,7 +10,7 @@
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ****************************************************************************/
 
 typedef struct guid_s
-{   
-    u32 v1; /* le */
-    u16 v2; /* le */
-    u16 v3; /* le */
-    u8  v4[8];
+{
+    uint32_t v1; /* le */
+    uint16_t v2; /* le */
+    uint16_t v3; /* le */
+    uint8_t  v4[8];
 } guid_t;
 
 static inline int CmpGuid( const guid_t *p_guid1, const guid_t *p_guid2 )
@@ -56,14 +56,14 @@ static void GenerateGuid( guid_t *p_guid )
     int i;
 
     srand( mdate() & 0xffffffff );
-    
+
     /* FIXME should be generated using random data */
     p_guid->v1 = 0xbabac001;
-    p_guid->v2 = ( (u64)rand() << 16 ) / RAND_MAX;
-    p_guid->v3 = ( (u64)rand() << 16 ) / RAND_MAX;
+    p_guid->v2 = ( (uint64_t)rand() << 16 ) / RAND_MAX;
+    p_guid->v3 = ( (uint64_t)rand() << 16 ) / RAND_MAX;
     for( i = 0; i < 8; i++ )
     {
-        p_guid->v4[i] = ( (u64)rand() * 256 ) / RAND_MAX;
+        p_guid->v4[i] = ( (uint64_t)rand() * 256 ) / RAND_MAX;
     }
 }
 
@@ -83,6 +83,14 @@ static const guid_t asf_object_header_guid =
     { 0xA6,0xD9, 0x00,0xAA,0x00,0x62,0xCE,0x6C }
 };
 
+static const guid_t asf_object_file_properties_guid =
+{
+    0x8cabdca1,
+    0xa947,
+    0x11cf,
+    { 0x8e,0xe4, 0x00,0xC0,0x0C,0x20,0x53,0x65 }
+};
+
 static const guid_t asf_object_stream_properties_guid =
 {
     0xB7DC0791,
index 4469e81c2ab929d512e61a8f05fe9c51644c337d..19c37ac5929701d0a9981864b8ee3dde0445e300 100644 (file)
@@ -2,7 +2,7 @@
  * mms.c: MMS access plug-in
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: mms.c,v 1.19 2003/02/20 01:52:45 sigmunau Exp $
+ * $Id: mms.c,v 1.20 2003/03/02 18:17:58 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -70,6 +70,8 @@
 #include "buffer.h"
 #include "mms.h"
 
+#undef MMS_DEBUG
+
 /****************************************************************************
  * NOTES:
  *  MMSProtocole documentation found at http://get.to/sdp
@@ -261,7 +263,13 @@ static int Open( vlc_object_t *p_this )
         p_input->stream.b_connected = 1;
     }
     p_input->stream.p_selected_area->i_tell = 0;
-    if( p_access->i_packet_count <= 0 )
+    /*
+     * i_flags_broadcast
+     *  yy xx ?? ??
+     *  broadcast    yy=0x02, xx= 0x00
+     *  pre-recorded yy=0x01, xx= 0x80 if video, 0x00 no video
+     */
+    if( p_access->i_packet_count <= 0 || ( p_access->i_flags_broadcast >> 24 ) == 0x02 )
     {
         p_input->stream.b_seekable = 0;
         p_input->stream.p_selected_area->i_size = 0;
@@ -867,7 +875,13 @@ static int MMSOpen( input_thread_t  *p_input,
                      buffer.p_data,
                      buffer.i_data );
 
-    mms_CommandRead( p_input, 0x01, 0 );
+    if( mms_CommandRead( p_input, 0x01, 0 ) < 0 )
+    {
+        var_buffer_free( &buffer );
+        MMSClose( p_input );
+        return( -1 );
+    }
+
     i_server_version = GetDWLE( p_access->p_cmd + MMS_CMD_HEADERSIZE + 32 );
     i_tool_version = GetDWLE( p_access->p_cmd + MMS_CMD_HEADERSIZE + 36 );
     i_update_player_url = GetDWLE( p_access->p_cmd + MMS_CMD_HEADERSIZE + 40 );
@@ -1483,7 +1497,7 @@ static int  NetFillBuffer( input_thread_t *p_input )
         i_udp_read = 0;
     }
 
-#if 1
+#if MMS_DEBUG
     if( p_access->i_proto == MMS_PROTO_UDP )
     {
         msg_Dbg( p_input,