[packages/gstreamer0.10-plugins-ugly: 13/46] - several fixes from livna - includes proper mp3 playback

qboosh qboosh at pld-linux.org
Fri Oct 5 16:52:16 CEST 2012


commit e577d52a083f8b6da97be101e8f5469871f8440a
Author: Patryk Zawadzki <patrys at room-303.com>
Date:   Thu Jan 17 16:59:53 2008 +0000

    - several fixes from livna
    - includes proper mp3 playback
    
    Changed files:
        gstreamer-plugins-ugly-asf-seek.patch -> 1.1
        gstreamer-plugins-ugly-dvdread.patch -> 1.1
        gstreamer-plugins-ugly-mpegaudioparse.patch -> 1.1

 gstreamer-plugins-ugly-asf-seek.patch       | 50 +++++++++++++++++++++++++
 gstreamer-plugins-ugly-dvdread.patch        | 32 ++++++++++++++++
 gstreamer-plugins-ugly-mpegaudioparse.patch | 57 +++++++++++++++++++++++++++++
 3 files changed, 139 insertions(+)
---
diff --git a/gstreamer-plugins-ugly-asf-seek.patch b/gstreamer-plugins-ugly-asf-seek.patch
new file mode 100644
index 0000000..7e52ebd
--- /dev/null
+++ b/gstreamer-plugins-ugly-asf-seek.patch
@@ -0,0 +1,50 @@
+diff -up gst-plugins-ugly-0.10.6/gst/asfdemux/gstasfdemux.c.seek gst-plugins-ugly-0.10.6/gst/asfdemux/gstasfdemux.c
+--- gst-plugins-ugly-0.10.6/gst/asfdemux/gstasfdemux.c.seek	2007-08-24 14:13:36.000000000 +0200
++++ gst-plugins-ugly-0.10.6/gst/asfdemux/gstasfdemux.c	2007-08-24 14:12:33.000000000 +0200
+@@ -492,19 +492,35 @@ gst_asf_demux_handle_seek_event (GstASFD
+   /* FIXME: should check the KEY_UNIT flag; need to adjust last_stop to
+    * real start of data and segment_start to indexed time for key unit seek*/
+   if (!gst_asf_demux_seek_index_lookup (demux, &packet, seek_time, &idx_time)) {
+-    /* Hackety hack, this sucks. We just seek to an earlier position
+-     *  and let the sinks throw away the stuff before the segment start */
+-    if (flush && (accurate || keyunit_sync)) {
+-      seek_time -= 5 * GST_SECOND;
+-      if (seek_time < 0)
+-        seek_time = 0;
+-    }
++    /* First try to query our source to see if it can convert for us. This is
++       the case when our source is an mms stream, notice that in this case
++       gstmms will do a time based seek to get the byte offset, this is not a
++       problem as the seek to this offset needs to happen anway. */
++    gint64 offset;
++    GstFormat dest_format = GST_FORMAT_BYTES;
++    
++    if (gst_pad_query_peer_convert (demux->sinkpad, GST_FORMAT_TIME, seek_time,
++           &dest_format, &offset) && dest_format == GST_FORMAT_BYTES) {
++      packet = (offset - demux->data_offset) / demux->packet_size;
++      GST_LOG_OBJECT (demux, "convert %" GST_TIME_FORMAT
++        " to bytes query result: %lld, data_ofset: %llu, packet_size: %u,"
++        " resulting packet: %u\n", GST_TIME_ARGS (seek_time), offset,
++        demux->data_offset, demux->packet_size, packet);
++    } else {
++      /* Hackety hack, this sucks. We just seek to an earlier position
++       *  and let the sinks throw away the stuff before the segment start */
++      if (flush && (accurate || keyunit_sync)) {
++        seek_time -= 5 * GST_SECOND;
++        if (seek_time < 0)
++          seek_time = 0;
++      }
+ 
+-    packet = (guint) gst_util_uint64_scale (demux->num_packets,
+-        seek_time, demux->play_time);
++      packet = (guint) gst_util_uint64_scale (demux->num_packets,
++          seek_time, demux->play_time);
+ 
+-    if (packet > demux->num_packets)
+-      packet = demux->num_packets;
++      if (packet > demux->num_packets)
++        packet = demux->num_packets;
++    }
+   } else {
+     if (keyunit_sync) {
+       GST_DEBUG_OBJECT (demux, "key unit seek, adjust seek_time = %"
diff --git a/gstreamer-plugins-ugly-dvdread.patch b/gstreamer-plugins-ugly-dvdread.patch
new file mode 100644
index 0000000..c867f4f
--- /dev/null
+++ b/gstreamer-plugins-ugly-dvdread.patch
@@ -0,0 +1,32 @@
+diff -up gst-plugins-ugly-0.10.6/ext/dvdread/dvdreadsrc.c.dvdread gst-plugins-ugly-0.10.6/ext/dvdread/dvdreadsrc.c
+--- gst-plugins-ugly-0.10.6/ext/dvdread/dvdreadsrc.c.dvdread	2007-12-18 14:48:23.000000000 +0100
++++ gst-plugins-ugly-0.10.6/ext/dvdread/dvdreadsrc.c	2007-12-18 14:48:58.000000000 +0100
+@@ -777,21 +777,21 @@ again:
+   }
+ 
+   /* read NAV packet */
+-nav_retry:
+-
+   len = DVDReadBlocks (src->dvd_title, src->cur_pack, 1, oneblock);
+-  if (len == 0)
++  if (len != 1)
+     goto read_error;
+ 
+   if (!gst_dvd_read_src_is_nav_pack (oneblock)) {
+-    GST_LOG_OBJECT (src, "Skipping nav packet @ pack %d", src->cur_pack);
+-    src->cur_pack++;
+-    goto nav_retry;
++    GST_LOG_OBJECT (src, "Expected nav packet @ pack %d", src->cur_pack);
++    goto read_error;
+   }
+ 
+   /* parse the contained dsi packet */
+   navRead_DSI (&dsi_pack, &oneblock[DSI_START_BYTE]);
+-  g_assert (src->cur_pack == dsi_pack.dsi_gi.nv_pck_lbn);
++  if (src->cur_pack != dsi_pack.dsi_gi.nv_pck_lbn) {
++    GST_ERROR ("src->cur_pack = %d, dsi_pack.dsi_gi.nv_pck_lbn = %d",
++        src->cur_pack, dsi_pack.dsi_gi.nv_pck_lbn);
++  }
+ 
+   /* determine where we go next. These values are the ones we
+    * mostly care about */
diff --git a/gstreamer-plugins-ugly-mpegaudioparse.patch b/gstreamer-plugins-ugly-mpegaudioparse.patch
new file mode 100644
index 0000000..a4a4219
--- /dev/null
+++ b/gstreamer-plugins-ugly-mpegaudioparse.patch
@@ -0,0 +1,57 @@
+diff -up gst-plugins-ugly-0.10.6/gst/mpegaudioparse/gstmpegaudioparse.h.orig gst-plugins-ugly-0.10.6/gst/mpegaudioparse/gstmpegaudioparse.h
+--- gst-plugins-ugly-0.10.6/gst/mpegaudioparse/gstmpegaudioparse.h.orig	2007-06-13 11:21:26.000000000 +0200
++++ gst-plugins-ugly-0.10.6/gst/mpegaudioparse/gstmpegaudioparse.h	2007-09-02 15:05:01.000000000 +0200
+@@ -82,6 +82,9 @@ struct _GstMPEGAudioParse {
+   guchar xing_seek_table[100];
+   guint32 xing_vbr_scale;
+   guint   xing_bitrate;
++
++  /* pending segment */
++  GstEvent *pending_segment;
+ };
+ 
+ struct _GstMPEGAudioParseClass {
+diff -up gst-plugins-ugly-0.10.6/gst/mpegaudioparse/gstmpegaudioparse.c.orig gst-plugins-ugly-0.10.6/gst/mpegaudioparse/gstmpegaudioparse.c
+--- gst-plugins-ugly-0.10.6/gst/mpegaudioparse/gstmpegaudioparse.c.orig	2007-06-13 11:21:26.000000000 +0200
++++ gst-plugins-ugly-0.10.6/gst/mpegaudioparse/gstmpegaudioparse.c	2007-09-02 15:04:25.000000000 +0200
+@@ -329,6 +329,7 @@ gst_mp3parse_sink_event (GstPad * pad, G
+ {
+   gboolean res;
+   GstMPEGAudioParse *mp3parse;
++  GstEvent **eventp;
+ 
+   mp3parse = GST_MP3PARSE (gst_pad_get_parent (pad));
+ 
+@@ -379,12 +380,18 @@ gst_mp3parse_sink_event (GstPad * pad, G
+       GST_DEBUG_OBJECT (mp3parse, "Pushing newseg rate %g, applied rate %g, "
+           "format %d, start %lld, stop %lld, pos %lld\n",
+           rate, applied_rate, format, start, stop, pos);
+-      res = gst_pad_push_event (mp3parse->srcpad, event);
++      /* save the segment for later, right before we push a new buffer so that
++       * the caps are fixed and the next linked element can receive the segment. */
++      eventp = &mp3parse->pending_segment;
++      gst_event_replace (eventp, event);
++      res = TRUE;
+       break;
+     }
+     case GST_EVENT_FLUSH_STOP:
+       /* Clear our adapter and set up for a new position */
+       gst_adapter_clear (mp3parse->adapter);
++      eventp = &mp3parse->pending_segment;
++      gst_event_replace (eventp, NULL);
+       res = gst_pad_push_event (mp3parse->srcpad, event);
+       break;
+     default:
+@@ -483,6 +490,12 @@ gst_mp3parse_emit_frame (GstMPEGAudioPar
+         mp3parse->srcpad, taglist);
+   }
+ 
++  /* push any pending segment now */
++  if (mp3parse->pending_segment) {
++    gst_pad_push_event (mp3parse->srcpad, mp3parse->pending_segment);
++    mp3parse->pending_segment = NULL;
++  }
++
+   return gst_pad_push (mp3parse->srcpad, outbuf);
+ }
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/gstreamer0.10-plugins-ugly.git/commitdiff/7500845ff8f8f8607350113332e067b8fea74bbe



More information about the pld-cvs-commit mailing list