rpms/libmms/devel libmms-0.5-patches.patch, NONE, 1.1 .cvsignore, 1.2, 1.3 libmms.spec, 1.4, 1.5 sources, 1.2, 1.3

Hans de Goede jwrdegoede at rpmfusion.org
Thu Feb 18 19:12:35 CET 2010


Author: jwrdegoede

Update of /cvs/free/rpms/libmms/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv19680

Modified Files:
	.cvsignore libmms.spec sources 
Added Files:
	libmms-0.5-patches.patch 
Log Message:
* Thu Feb 18 2010 Hans de Goede <j.w.r.degoede at hhs.nl> 0.5-1
- New upstream release 0.5 (rf1053)
- Fix some regressions introduced by upstream
- Add a bunch of home grown patches (I used to be part of upstream, but
  upstream has moved to launchpad), fixing several bugs and cleaning up
  the code left and right, all these are submitted upstream


libmms-0.5-patches.patch:
 b/src/asfheader.h |    6 
 b/src/mms.c       |   14 
 b/src/mmsh.c      |  159 +++++++--
 b/src/uri.c       |    7 
 b/src/uri.h       |    3 
 src/mms.c         |  898 ++++++++++++++++++++++++------------------------------
 src/mmsh.c        |  435 ++++++++++----------------
 7 files changed, 717 insertions(+), 805 deletions(-)

--- NEW FILE libmms-0.5-patches.patch ---
>From 47c51e11e1969a5143eb953489921d4d632ff852 Mon Sep 17 00:00:00 2001
From: Hans de Goede <j.w.r.degoede at hhs.nl>
Date: Fri, 5 Feb 2010 17:27:38 +0100
Subject: [PATCH 01/22] Add upstream patch checking for bitpos pointing outside the header

Note the check is wron <= should be <, will fix this in a separate
patch (to send back upstream).
---
 src/mms.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/mms.c b/src/mms.c
index 0884f6a..bb37077 100644
--- a/src/mms.c
+++ b/src/mms.c
@@ -1021,10 +1021,15 @@ int static mms_choose_best_streams(mms_io_t *io, mms_t *this) {
       
       /* forces the asf demuxer to not choose this stream */
       if (this->streams[i].bitrate_pos) {
-        this->asf_header[this->streams[i].bitrate_pos    ] = 0;
-        this->asf_header[this->streams[i].bitrate_pos + 1] = 0;
-        this->asf_header[this->streams[i].bitrate_pos + 2] = 0;
-        this->asf_header[this->streams[i].bitrate_pos + 3] = 0;
+        if (this->streams[i].bitrate_pos+3 <= ASF_HEADER_LEN) {
+          this->asf_header[this->streams[i].bitrate_pos    ] = 0;
+          this->asf_header[this->streams[i].bitrate_pos + 1] = 0;
+          this->asf_header[this->streams[i].bitrate_pos + 2] = 0;
+          this->asf_header[this->streams[i].bitrate_pos + 3] = 0;
+        } else {
+          lprintf("***LOG:*** -- "
+                  "libmms: attempt to write beyond asf header limit");
+        }
       }
     }
   }
-- 
1.7.0

>From e714a1410c260cb551a6c17dd4b8137644b9dc12 Mon Sep 17 00:00:00 2001
From: Hans de Goede <j.w.r.degoede at hhs.nl>
Date: Fri, 5 Feb 2010 17:39:54 +0100
Subject: [PATCH 02/22] Add support for GUID_ASF_EXTENDED_STREAM_PROPERTIES to mssh support

Patch from upstream bazar.
---
 src/asfheader.h |    6 ++-
 src/mmsh.c      |  158 +++++++++++++++++++++++++++++++++++++++++--------------
 2 files changed, 123 insertions(+), 41 deletions(-)

diff --git a/src/asfheader.h b/src/asfheader.h
index 09d94ed..2aaffb3 100644
--- a/src/asfheader.h
+++ b/src/asfheader.h
@@ -93,8 +93,9 @@
 #define GUID_ASF_AUDIO_CONCEAL_NONE            34
 #define GUID_ASF_CODEC_COMMENT1_HEADER         35
 #define GUID_ASF_2_0_HEADER                    36
+#define GUID_ASF_EXTENDED_STREAM_PROPERTIES    37
 
-#define GUID_END                               37
+#define GUID_END                               38
 
 
 /* asf stream types */
@@ -256,6 +257,9 @@ static const struct
     { "asf 2.0 header",
     { 0xd6e229d1, 0x35da, 0x11d1, { 0x90, 0x34, 0x00, 0xa0, 0xc9, 0x03, 0x49, 0xbe }} },
 
+    { "extended stream properties",
+    { 0x14e6a5cb, 0xc672, 0x4332, { 0x83, 0x99, 0xa9, 0x69, 0x52, 0x06, 0x5b, 0x5a }} },
+
 };
 
 #endif
diff --git a/src/mmsh.c b/src/mmsh.c
index cd5ef9b..bc9da5a 100644
--- a/src/mmsh.c
+++ b/src/mmsh.c
@@ -605,6 +605,47 @@ static int get_header (mms_io_t *io, mmsh_t *this) {
   }
 }
 
+static void interp_stream_properties(mmsh_t *this, int i) {
+  uint16_t flags;
+  uint16_t stream_id;
+  int      type;
+  int      encrypted;
+  int      guid;
+
+  guid = get_guid(this->asf_header, i);
+  switch (guid) {
+    case GUID_ASF_AUDIO_MEDIA:
+      type = ASF_STREAM_TYPE_AUDIO;
+      this->has_audio = 1;
+      break;
+
+    case GUID_ASF_VIDEO_MEDIA:
+    case GUID_ASF_JFIF_MEDIA:
+    case GUID_ASF_DEGRADABLE_JPEG_MEDIA:
+      type = ASF_STREAM_TYPE_VIDEO;
+      this->has_video = 1;
+      break;
+
+    case GUID_ASF_COMMAND_MEDIA:
+      type = ASF_STREAM_TYPE_CONTROL;
+      break;
+
+    default:
+      type = ASF_STREAM_TYPE_UNKNOWN;
+  }
+
+  flags = LE_16(this->asf_header + i + 48);
+  stream_id = flags & 0x7F;
+  encrypted = flags >> 15;
+
+  lprintf ("stream object, stream id: %d, type: %d, encrypted: %d\n",
+      stream_id, type, encrypted);
+
+  this->stream_types[stream_id] = type;
+  this->stream_ids[this->num_stream_ids] = stream_id;
+  this->num_stream_ids++;
+}
+
 static void interp_header (mms_io_t *io, mmsh_t *this) {
 
   int i;
@@ -651,46 +692,7 @@ static void interp_header (mms_io_t *io, mmsh_t *this) {
         break;
 
       case GUID_ASF_STREAM_PROPERTIES:
-        {
-	  uint16_t flags;
-          uint16_t stream_id;
-          int      type;
-	  int      encrypted;
-
-          guid = get_guid(this->asf_header, i);
-          switch (guid) {
-            case GUID_ASF_AUDIO_MEDIA:
-              type = ASF_STREAM_TYPE_AUDIO;
-              this->has_audio = 1;
-              break;
-
-            case GUID_ASF_VIDEO_MEDIA:
-	    case GUID_ASF_JFIF_MEDIA:
-	    case GUID_ASF_DEGRADABLE_JPEG_MEDIA:
-              type = ASF_STREAM_TYPE_VIDEO;
-              this->has_video = 1;
-              break;
-
-            case GUID_ASF_COMMAND_MEDIA:
-              type = ASF_STREAM_TYPE_CONTROL;
-              break;
-
-            default:
-              type = ASF_STREAM_TYPE_UNKNOWN;
-          }
-
-	  flags = LE_16(this->asf_header + i + 48);
-	  stream_id = flags & 0x7F;
-	  encrypted = flags >> 15;
-
-          lprintf ("stream object, stream id: %d, type: %d, encrypted: %d\n",
-		   stream_id, type, encrypted);
-
-          this->stream_types[stream_id] = type;
-          this->stream_ids[this->num_stream_ids] = stream_id;
-          this->num_stream_ids++;
-
-        }
+        interp_stream_properties(this, i);
         break;
 
       case GUID_ASF_STREAM_BITRATE_PROPERTIES:
@@ -714,6 +716,82 @@ static void interp_header (mms_io_t *io, mmsh_t *this) {
         }
         break;
 
+      case GUID_ASF_HEADER_EXTENSION:
+        {
+          int size = LE_32(this->asf_header + i + 18);
+          int j = 22;
+          int l;
+          lprintf("Extension header data size: %d\n", size);
+
+          while( (j+24) < length ) {
+            guid = get_guid(this->asf_header, i + j);
+            j += 16;
+
+            l = LE_64(this->asf_header + i + j);
+            j += 8;
+
+            switch(guid) {
+              case GUID_ASF_EXTENDED_STREAM_PROPERTIES:
+                {
+                  int stream_no = LE_16(this->asf_header + i + j + 48);
+                  int name_count = LE_16(this->asf_header + i + j + 60);
+                  int ext_count = LE_16(this->asf_header + i + j + 62);
+                  int ext_j = 64;
[...3403 lines suppressed...]
-
-
 /*
  * returns 1 on error
  */
 static int mms_tcp_connect(mms_io_t *io, mms_t *this) {
-  int progress, res;
-  
   if (!this->port) this->port = MMST_PORT;
 
   /* 
@@ -887,17 +864,6 @@ static int mms_tcp_connect(mms_io_t *io, mms_t *this) {
     return 1;
   }
 
-  /* connection timeout 15s */
-  progress = 0;
-  do {
-    /*FIXME: de-xine-ification */
-/*     report_progress(this->stream, progress); */
-    res = io_select(io,  this->s, MMS_IO_WRITE_READY, 500);
-    progress += 1;
-  } while ((res == MMS_IO_STATUS_TIMEOUT) && (progress < 30));
-  if (res != MMS_IO_STATUS_READY) {
-    return 1;
-  }
   lprintf("mms: connected\n");
   return 0;
 }
@@ -1065,7 +1031,6 @@ mms_t *mms_connect (mms_io_t *io, void *data, const char *url, int bandwidth) {
   /* FIXME: needs proper error-signalling work */
   this = (mms_t*) malloc (sizeof (mms_t));
 
-  this->custom_data     = data;
   this->url             = strdup (url);
   this->s               = -1;
   this->seq_num         = 0;
@@ -1085,9 +1050,6 @@ mms_t *mms_connect (mms_io_t *io, void *data, const char *url, int bandwidth) {
   this->current_pos     = 0;
   this->eos             = 0;
 
-  /* FIXME de-xine-ification */
-/*   report_progress (stream, 0); */
-  
   this->guri = gnet_uri_new(this->url);
   if(!this->guri) {
     lprintf("mms: invalid url\n");
@@ -1115,8 +1077,6 @@ mms_t *mms_connect (mms_io_t *io, void *data, const char *url, int bandwidth) {
   if (mms_tcp_connect(io, this)) {
     goto fail;
   }
-  /* FIXME de-xine-ification */
-/*   report_progress (stream, 30); */
   
   url_conv = iconv_open("UTF-16LE", "UTF-8");
   if (url_conv == (iconv_t)-1) {
@@ -1157,9 +1117,6 @@ mms_t *mms_connect (mms_io_t *io, void *data, const char *url, int bandwidth) {
     goto fail;
   }
 
-  /* FIXME de-xine-ification */
-/*   report_progress (stream, 40); */
-
   /* TODO: insert network timing request here */
   /* command 0x2 */
   lprintf("mms: send command 0x02\n");
@@ -1197,9 +1154,6 @@ mms_t *mms_connect (mms_io_t *io, void *data, const char *url, int bandwidth) {
     goto fail;
   }
 
-  /* FIXME de-xine-ification */
-/*   report_progress (stream, 50); */
-
   /* command 0x5 */
   {
     mms_buffer_t command_buffer;
@@ -1252,9 +1206,6 @@ mms_t *mms_connect (mms_io_t *io, void *data, const char *url, int bandwidth) {
     goto fail;
   }
 
-  /* FIXME de-xine-ification */
-/*   report_progress (stream, 60); */
-
   /* command 0x15 */
   lprintf("mms: send command 0x15\n");
   {
@@ -1297,17 +1248,11 @@ mms_t *mms_connect (mms_io_t *io, void *data, const char *url, int bandwidth) {
   if (!this->asf_packet_len || !this->num_stream_ids)
     goto fail;
 
-  /* FIXME de-xine-ification */
-/*   report_progress (stream, 70); */
-
   if (!mms_choose_best_streams(io, this)) {
     lprintf("mms: mms_choose_best_streams failed\n");
     goto fail;
   }
 
-  /* FIXME de-xine-ification */
-/*   report_progress (stream, 80); */
-
   /* command 0x07 */
   this->packet_id_type = ASF_MEDIA_PACKET_ID_TYPE;
   {
@@ -1328,8 +1273,6 @@ mms_t *mms_connect (mms_io_t *io, void *data, const char *url, int bandwidth) {
     }
   }
 
-/*   report_progress (stream, 100); */
-
   iconv_close(url_conv);
   lprintf("mms: connect: passed\n");
  
diff --git a/src/mmsh.c b/src/mmsh.c
index cd396c9..dd6e39d 100644
--- a/src/mmsh.c
+++ b/src/mmsh.c
@@ -151,9 +151,6 @@ static const char* mmsh_RangeRequest =
 
 struct mmsh_s {
 
-  /* FIXME: de-xine-ification */
-  void *custom_data;
-
   int           s;
 
   /* url parsing */
@@ -810,8 +807,6 @@ static int mmsh_valid_proto (char *proto) {
  * returns 1 on error
  */
 static int mmsh_tcp_connect(mms_io_t *io, mmsh_t *this) {
-  int progress, res;
-  
   if (!this->connect_port) this->connect_port = MMSH_PORT;
   
   /* 
@@ -826,18 +821,6 @@ static int mmsh_tcp_connect(mms_io_t *io, mmsh_t *this) {
     return 1;
   }
 
-  /* connection timeout 15s */
-  progress = 0;
-  do {
-//    report_progress(this->stream, progress);
-    res = io_select (io, this->s, MMS_IO_WRITE_READY, 500);
-    progress += 1;
-  } while ((res == MMS_IO_STATUS_TIMEOUT) && (progress < 30));
-  if (res != MMS_IO_STATUS_READY) {
-    close (this->s);
-    this->s = -1;
-    return 1;
-  }
   lprintf("mmsh: connected\n");
 
   return 0;
@@ -862,7 +845,6 @@ static int mmsh_connect_int (mms_io_t *io, mmsh_t *this, off_t seek, uint32_t ti
   if (mmsh_tcp_connect(io, this)) {
     return 0;
   }
-//  report_progress (stream, 30);
 
   /*
    * let the negotiations begin...
@@ -890,8 +872,6 @@ static int mmsh_connect_int (mms_io_t *io, mmsh_t *this, off_t seek, uint32_t ti
     goto fail;
   
   close(this->s);
-//  report_progress (stream, 20);
-
   
   /* choose the best quality for the audio stream */
   /* i've never seen more than one audio stream */
@@ -1041,7 +1021,6 @@ mmsh_t *mmsh_connect (mms_io_t *io, void *data, const char *url, int bandwidth)
   if (!url)
     return NULL;
 
-//  report_progress (stream, 0);
   /*
    * initializatoin is essential here.  the fail: label depends
    * on the various char * in our this structure to be
@@ -1059,7 +1038,6 @@ mmsh_t *mmsh_connect (mms_io_t *io, void *data, const char *url, int bandwidth)
   this->host_password = NULL;
   this->uri = NULL;
 
-  this->custom_data     = data;
   this->url             = strdup(url);
   if ((proxy_env = getenv("http_proxy")) != NULL)
     this->proxy_url = strdup(proxy_env);
@@ -1078,8 +1056,6 @@ mmsh_t *mmsh_connect (mms_io_t *io, void *data, const char *url, int bandwidth)
   this->user_bandwidth  = bandwidth;
   this->http_request_number = 1;
 
-//  report_progress (stream, 0);
-
   if (this->proxy_url) {
     proxy_uri = gnet_uri_new(this->proxy_url);
     if (!proxy_uri) {
-- 
1.7.0



Index: .cvsignore
===================================================================
RCS file: /cvs/free/rpms/libmms/devel/.cvsignore,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- .cvsignore	4 May 2008 13:22:17 -0000	1.2
+++ .cvsignore	18 Feb 2010 18:12:35 -0000	1.3
@@ -1 +1 @@
-libmms-0.4.tar.gz
+libmms-0.5.tar.gz


Index: libmms.spec
===================================================================
RCS file: /cvs/free/rpms/libmms/devel/libmms.spec,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- libmms.spec	29 Mar 2009 13:27:16 -0000	1.4
+++ libmms.spec	18 Feb 2010 18:12:35 -0000	1.5
@@ -1,11 +1,14 @@
 Name:          libmms
-Version:       0.4
-Release:       4%{?dist}
+Version:       0.5
+Release:       1%{?dist}
 Summary:       Library for Microsoft Media Server (MMS) streaming protocol
 License:       LGPLv2+
 Group:         System Environment/Libraries
-URL:           http://libmms.sourceforge.net/
-Source0:       http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
+URL:           http://launchpad.net/libmms
+Source0:       http://launchpad.net/libmms/trunk/0.5/+download/libmms-%{version}.tar.gz
+# Various patches from / heading into upstream bazar concatenated into 1
+# see the git headers inside the file for details
+Patch0:        libmms-0.5-patches.patch
 BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: glib2-devel
 
@@ -28,9 +31,11 @@
 
 %prep
 %setup -q
+%patch0 -p1
 
 
 %build
+export CFLAGS="$RPM_OPT_FLAGS -Wno-pointer-sign"
 %configure --disable-dependency-tracking --disable-static
 make %{?_smp_mflags} 
 
@@ -61,6 +66,13 @@
 
 
 %changelog
+* Thu Feb 18 2010 Hans de Goede <j.w.r.degoede at hhs.nl> 0.5-1
+- New upstream release 0.5 (rf1053)
+- Fix some regressions introduced by upstream
+- Add a bunch of home grown patches (I used to be part of upstream, but
+  upstream has moved to launchpad), fixing several bugs and cleaning up
+  the code left and right, all these are submitted upstream
+
 * Sun Mar 29 2009 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info> - 0.4-4
 - rebuild for new F11 features
 


Index: sources
===================================================================
RCS file: /cvs/free/rpms/libmms/devel/sources,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- sources	4 May 2008 13:22:17 -0000	1.2
+++ sources	18 Feb 2010 18:12:35 -0000	1.3
@@ -1 +1 @@
-4a681a815186fe26bb1b02ccea57fb75  libmms-0.4.tar.gz
+cf83053ec891f14e73a04c84d9de08ee  libmms-0.5.tar.gz



More information about the rpmfusion-commits mailing list