~ubuntu-branches/ubuntu/feisty/gst-plugins-good0.10/feisty-security

« back to all changes in this revision

Viewing changes to gst/apetag/gsttagdemux.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2006-12-21 21:12:15 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20061221211215-3uukkusokhe0nk4f
Tags: 0.10.5-0ubuntu1
* Sync with pkg-gstreamer SVN:
  + debian/rules:
    - Use Ubuntu as distribution name and point to the proper Launchpad URL
  + debian/patches/01_esdsink-priority.patch:
    - Mark the esdsink with rank primary-2 to get
      pulse > alsadmix > esd > alsa > oss

Show diffs side-by-side

added added

removed removed

Lines of Context:
329
329
        tagdemux->priv->src_caps);
330
330
 
331
331
    gst_object_ref (tagdemux->priv->srcpad);
 
332
    gst_pad_set_active (tagdemux->priv->srcpad, TRUE);
332
333
    if (!(gst_element_add_pad (GST_ELEMENT (tagdemux), tagdemux->priv->srcpad)))
333
334
      return FALSE;
334
335
    gst_element_no_more_pads (GST_ELEMENT (tagdemux));
457
458
  guint tagsize = 0;
458
459
  guint available;
459
460
 
 
461
  g_assert (gst_buffer_is_metadata_writable (collect));
 
462
 
460
463
  klass = GST_TAG_DEMUX_CLASS (G_OBJECT_GET_CLASS (demux));
461
464
 
462
465
  /* If we receive a buffer that's from the middle of the file, 
463
466
   * we can't read tags so move to typefinding */
464
 
  if (GST_BUFFER_OFFSET (collect) != 0) {
 
467
  if (GST_BUFFER_OFFSET_IS_VALID (collect) && GST_BUFFER_OFFSET (collect) != 0) {
465
468
    GST_DEBUG_OBJECT (demux, "Received buffer from non-zero offset %"
466
469
        G_GINT64_FORMAT ". Can't read tags", GST_BUFFER_OFFSET (collect));
467
470
    demux->priv->state = GST_TAG_DEMUX_TYPEFINDING;
485
488
    return;
486
489
  }
487
490
 
 
491
  /* need to set offset of first buffer to 0 or trimming won't work */
 
492
  if (!GST_BUFFER_OFFSET_IS_VALID (collect)) {
 
493
    GST_WARNING_OBJECT (demux, "Fixing up first buffer without offset");
 
494
    GST_BUFFER_OFFSET (collect) = 0;
 
495
  }
 
496
 
488
497
  GST_DEBUG_OBJECT (demux, "Identified tag, size = %u bytes", tagsize);
489
498
 
490
499
  do {
549
558
 
550
559
  switch (demux->priv->state) {
551
560
    case GST_TAG_DEMUX_READ_START_TAG:
 
561
      demux->priv->collect =
 
562
          gst_buffer_make_metadata_writable (demux->priv->collect);
552
563
      gst_tag_demux_chain_parse_tag (demux, demux->priv->collect);
553
564
      if (demux->priv->state != GST_TAG_DEMUX_TYPEFINDING)
554
565
        break;