r743 - in /unstable/libmms/debian: changelog patches/11_fix-stream-id-crash.patch patches/series

lool at users.alioth.debian.org lool at users.alioth.debian.org
Fri Mar 30 13:23:46 CET 2007


Author: lool
Date: Fri Mar 30 12:23:45 2007
New Revision: 743

URL: http://svn.debian.org/wsvn/pkg-multimedia/?sc=1&rev=743
Log:
* New patch, 11_fix-stream-id-crash, fixes support of streams with id above
  23; see GNOME #347151 and SF bug #1521441; thanks Sven Arvidsson;
  closes: #416430.

Added:
    unstable/libmms/debian/patches/11_fix-stream-id-crash.patch
Modified:
    unstable/libmms/debian/changelog
    unstable/libmms/debian/patches/series

Modified: unstable/libmms/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-multimedia/unstable/libmms/debian/changelog?rev=743&op=diff
==============================================================================
--- unstable/libmms/debian/changelog (original)
+++ unstable/libmms/debian/changelog Fri Mar 30 12:23:45 2007
@@ -1,4 +1,4 @@
-libmms (0.3-3) UNRELEASED; urgency=low
+libmms (0.3-3) unstable; urgency=low
 
   * Set Maintainer to pkg-multimedia-maintainers and list myself as Uploader.
   * Don't pass --host to configure if DEB_BUILD_GNU_TYPE equals
@@ -7,8 +7,11 @@
   * Bump up Debhelper compatibility level to 5.
     - Drop usr/share/pkgconfig from libmms-dev.install.
   * Stop shipping /usr/lib/libmms.la in libmms-dev; no rdep.
+  * New patch, 11_fix-stream-id-crash, fixes support of streams with id above
+    23; see GNOME #347151 and SF bug #1521441; thanks Sven Arvidsson;
+    closes: #416430.
 
- -- Loic Minier <lool at dooz.org>  Fri, 30 Mar 2007 14:12:27 +0200
+ -- Loic Minier <lool at dooz.org>  Fri, 30 Mar 2007 14:18:38 +0200
 
 libmms (0.3-2) unstable; urgency=low
 

Added: unstable/libmms/debian/patches/11_fix-stream-id-crash.patch
URL: http://svn.debian.org/wsvn/pkg-multimedia/unstable/libmms/debian/patches/11_fix-stream-id-crash.patch?rev=743&op=file
==============================================================================
--- unstable/libmms/debian/patches/11_fix-stream-id-crash.patch (added)
+++ unstable/libmms/debian/patches/11_fix-stream-id-crash.patch Fri Mar 30 12:23:45 2007
@@ -1,0 +1,176 @@
+GNOME #347151; SF #1521441; fixes support of streams with id above 23
+http://sourceforge.net/tracker/index.php?func=detail&aid=1521441&group_id=101989&atid=630609
+
+diff -urp ../libmms-0.3.orig/src/mms.c ./src/mms.c
+--- ../libmms-0.3.orig/src/mms.c	2006-07-13 14:32:20.000000000 +0200
++++ ./src/mms.c	2007-03-27 23:15:38.000000000 +0200
+@@ -106,6 +106,13 @@ struct mms_packet_header_s {
+   uint32_t  packet_seq;
+ };
+ 
++typedef struct mms_stream_s mms_stream_t;
++struct mms_stream_s {
++  int           stream_id;
++  int           stream_type;
++  uint32_t      bitrate;
++  uint32_t      bitrate_pos;
++};
+ 
+ struct mms_s {
+ 
+@@ -140,15 +147,12 @@ struct mms_s {
+   uint32_t      asf_header_read;
+   int           seq_num;
+   int           num_stream_ids;
+-  int           stream_ids[ASF_MAX_NUM_STREAMS];
+-  int           stream_types[ASF_MAX_NUM_STREAMS];
++  mms_stream_t  streams[ASF_MAX_NUM_STREAMS];
+   off_t         start_packet_seq; /* for live streams != 0, need to keep it around */
+   int           need_discont; /* whether we need to set start_packet_seq */
+   uint32_t      asf_packet_len;
+   uint64_t      file_len;
+   char          guid[37];
+-  uint32_t      bitrates[ASF_MAX_NUM_STREAMS];
+-  uint32_t      bitrates_pos[ASF_MAX_NUM_STREAMS];
+   int           bandwidth;
+   
+   int           has_audio;
+@@ -776,9 +780,9 @@ static void interp_asf_header (mms_t *th
+           lprintf ("stream object, stream id: %d, type: %d, encrypted: %d\n",
+ 		   stream_id, type, encrypted);
+ 
+-	  if (this->num_stream_ids < ASF_MAX_NUM_STREAMS && stream_id < ASF_MAX_NUM_STREAMS) {
+-	    this->stream_types[stream_id] = type;
+-	    this->stream_ids[this->num_stream_ids] = stream_id;
++	  if (this->num_stream_ids < ASF_MAX_NUM_STREAMS) {
++	    this->streams[this->num_stream_ids].stream_type = type;
++	    this->streams[this->num_stream_ids].stream_id = stream_id;
+ 	    this->num_stream_ids++;
+ 	  } else {
+ 	    lprintf ("too many streams, skipping\n");
+@@ -796,12 +800,19 @@ static void interp_asf_header (mms_t *th
+           lprintf ("streams %d\n", streams); 
+ 
+           for(j = 0; j < streams; j++) {
++            int stream_index;
+             stream_id = LE_16(this->asf_header + i + 2 + j * 6);
+-            lprintf ("stream id %d\n", stream_id); 
+-            this->bitrates[stream_id] = LE_32(this->asf_header + i + 4 + j * 6);
+-            this->bitrates_pos[stream_id] = i + 4 + j * 6;
+-            lprintf ("stream id %d, bitrate %d\n", stream_id, 
+-                     this->bitrates[stream_id]);
++            lprintf ("stream id %d\n", stream_id);
++            for(stream_index = 0; stream_index < this->num_stream_ids; stream_index++) {
++              if (this->streams[stream_index].stream_id == stream_id)
++                break;
++            }
++            if (stream_index < this->num_stream_ids) {
++              this->streams[stream_index].bitrate = LE_32(this->asf_header + i + 4 + j * 6);
++              this->streams[stream_index].bitrate_pos = i + 4 + j * 6;
++              lprintf ("stream id %d, bitrate %d\n", stream_id, 
++                     this->[stream_index].bitrate);
++            }
+           }
+         }
+         break;
+@@ -913,7 +924,6 @@ int static mms_choose_best_streams(mms_i
+   int     max_arate    = 0;
+   int     min_vrate    = 0;
+   int     min_bw_left  = 0;
+-  int     stream_id;
+   int     bandwitdh_left;
+   int     res;
+ 
+@@ -922,12 +932,11 @@ int static mms_choose_best_streams(mms_i
+   /* i've never seen more than one audio stream */
+   lprintf("num_stream_ids=%d\n", this->num_stream_ids);
+   for (i = 0; i < this->num_stream_ids; i++) {
+-    stream_id = this->stream_ids[i];
+-    switch (this->stream_types[stream_id]) {
++    switch (this->streams[i].stream_type) {
+       case ASF_STREAM_TYPE_AUDIO:
+-        if (this->bitrates[stream_id] > max_arate) {
+-          audio_stream = stream_id;
+-          max_arate = this->bitrates[stream_id];
++        if (this->streams[i].bitrate > max_arate) {
++          audio_stream = this->streams[i].stream_id;
++          max_arate = this->streams[i].bitrate;
+         }
+         break;
+       default:
+@@ -944,13 +953,12 @@ int static mms_choose_best_streams(mms_i
+ 
+   min_bw_left = bandwitdh_left;
+   for (i = 0; i < this->num_stream_ids; i++) {
+-    stream_id = this->stream_ids[i];
+-    switch (this->stream_types[stream_id]) {
++    switch (this->streams[i].stream_type) {
+       case ASF_STREAM_TYPE_VIDEO:
+-        if (((bandwitdh_left - this->bitrates[stream_id]) < min_bw_left) &&
+-            (bandwitdh_left >= this->bitrates[stream_id])) {
+-          video_stream = stream_id;
+-          min_bw_left = bandwitdh_left - this->bitrates[stream_id];
++        if (((bandwitdh_left - this->streams[i].bitrate) < min_bw_left) &&
++            (bandwitdh_left >= this->streams[i].bitrate)) {
++          video_stream = this->streams[i].stream_id;
++          min_bw_left = bandwitdh_left - this->streams[i].bitrate;
+         }
+         break;
+       default:
+@@ -961,13 +969,12 @@ int static mms_choose_best_streams(mms_i
+   /* choose the lower bitrate of */
+   if (!video_stream && this->has_video) {
+     for (i = 0; i < this->num_stream_ids; i++) {
+-      stream_id = this->stream_ids[i];
+-      switch (this->stream_types[stream_id]) {
++      switch (this->streams[i].stream_type) {
+         case ASF_STREAM_TYPE_VIDEO:
+-          if ((this->bitrates[stream_id] < min_vrate) ||
++          if ((this->streams[i].bitrate < min_vrate) ||
+               (!min_vrate)) {
+-            video_stream = stream_id;
+-            min_vrate = this->bitrates[stream_id];
++            video_stream = this->streams[i].stream_id;
++            min_vrate = this->streams[i].bitrate;
+           }
+           break;
+         default:
+@@ -982,10 +989,10 @@ int static mms_choose_best_streams(mms_i
+   for (i = 1; i < this->num_stream_ids; i++) {
+     this->scmd_body [ (i - 1) * 6 + 2 ] = 0xFF;
+     this->scmd_body [ (i - 1) * 6 + 3 ] = 0xFF;
+-    this->scmd_body [ (i - 1) * 6 + 4 ] = this->stream_ids[i] ;
+-    this->scmd_body [ (i - 1) * 6 + 5 ] = this->stream_ids[i] >> 8;
+-    if ((this->stream_ids[i] == audio_stream) ||
+-        (this->stream_ids[i] == video_stream)) {
++    this->scmd_body [ (i - 1) * 6 + 4 ] = this->streams[i].stream_id ;
++    this->scmd_body [ (i - 1) * 6 + 5 ] = this->streams[i].stream_id >> 8;
++    if ((this->streams[i].stream_id == audio_stream) ||
++        (this->streams[i].stream_id == video_stream)) {
+       this->scmd_body [ (i - 1) * 6 + 6 ] = 0x00;
+       this->scmd_body [ (i - 1) * 6 + 7 ] = 0x00;
+     } else {
+@@ -994,17 +1001,17 @@ int static mms_choose_best_streams(mms_i
+       this->scmd_body [ (i - 1) * 6 + 7 ] = 0x00;
+       
+       /* forces the asf demuxer to not choose this stream */
+-      if (this->bitrates_pos[this->stream_ids[i]]) {
+-        this->asf_header[this->bitrates_pos[this->stream_ids[i]]]     = 0;
+-        this->asf_header[this->bitrates_pos[this->stream_ids[i]] + 1] = 0;
+-        this->asf_header[this->bitrates_pos[this->stream_ids[i]] + 2] = 0;
+-        this->asf_header[this->bitrates_pos[this->stream_ids[i]] + 3] = 0;
++      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 (!send_command (io, this, 0x33, this->num_stream_ids, 
+-                     0xFFFF | this->stream_ids[0] << 16, 
++                     0xFFFF | this->streams[0].stream_id << 16, 
+                      this->num_stream_ids * 6 + 2)) {
+   /* FIXME: de-xine-ification */
+     lprintf ( "***LOG:*** -- "

Modified: unstable/libmms/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-multimedia/unstable/libmms/debian/patches/series?rev=743&op=diff
==============================================================================
--- unstable/libmms/debian/patches/series (original)
+++ unstable/libmms/debian/patches/series Fri Mar 30 12:23:45 2007
@@ -1,1 +1,2 @@
 10_asf-header-size.patch
+11_fix-stream-id-crash.patch




More information about the pkg-multimedia-commits mailing list