ext/theora/theoradec.c: make comments work

Original commit message from CVS:
2004-01-31  Benjamin Otte  <in7y118@public.uni-hamburg.de>

* ext/theora/theoradec.c: (theora_dec_chain):
make comments work
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_chain):
add encoder tag, fix tag reading to be more error tolerant, change
BITRATE to NOMINAL_BITRATE, add debugging, don't unref events after
gst_pad_event_default.
* gst/tags/gstvorbistag.c:
(gst_tag_list_from_vorbiscomment_buffer):
undefine function specific define at end of function
This commit is contained in:
Benjamin Otte 2004-01-31 11:24:18 +00:00
parent 966252d6fd
commit f8dd2b328e
4 changed files with 40 additions and 5 deletions

View file

@ -1,3 +1,16 @@
2004-01-31 Benjamin Otte <in7y118@public.uni-hamburg.de>
* ext/theora/theoradec.c: (theora_dec_chain):
make comments work
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_query),
(vorbis_dec_src_event), (vorbis_dec_chain):
add encoder tag, fix tag reading to be more error tolerant, change
BITRATE to NOMINAL_BITRATE, add debugging, don't unref events after
gst_pad_event_default.
* gst/tags/gstvorbistag.c:
(gst_tag_list_from_vorbiscomment_buffer):
undefine function specific define at end of function
2004-01-31 Jeremy Simon <jesimon@libertysurf.fr>
* ext/flac/gstflac.c: (plugin_init):

View file

@ -248,7 +248,17 @@ theora_dec_chain (GstPad *pad, GstData *data)
return;
}
if (packet.packetno == 1) {
GstTagList *list = gst_tag_list_from_vorbiscomment_buffer (buf, "\101theora", 7, NULL);
gchar *encoder = NULL;
GstTagList *list = gst_tag_list_from_vorbiscomment_buffer (buf, "\201theora", 7, &encoder);
if (!list) {
GST_ERROR_OBJECT (dec, "failed to parse tags");
list = gst_tag_list_new ();
}
if (encoder) {
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
GST_TAG_ENCODER, encoder, NULL);
g_free (encoder);
}
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
GST_TAG_ENCODER_VERSION, dec->info.version_major, NULL);
gst_element_found_tags_for_pad (GST_ELEMENT (dec), dec->srcpad, 0, list);

View file

@ -211,7 +211,8 @@ vorbis_dec_src_query (GstPad *pad, GstQueryType query, GstFormat *format, gint64
if (!vorbis_dec_from_granulepos (dec, *format, granulepos, value))
return FALSE;
g_print ("peer returned granulepos: %llu - we return %llu\n", granulepos, *value);
GST_LOG_OBJECT (dec, "query %u: peer returned granulepos: %llu - we return %llu (format %u)\n",
query, granulepos, *value, *format);
return TRUE;
}
@ -233,6 +234,7 @@ vorbis_dec_src_event (GstPad *pad, GstEvent *event)
value);
res = gst_pad_send_event (GST_PAD_PEER (dec->sinkpad), real_seek);
}
gst_event_unref (event);
break;
}
default:
@ -240,7 +242,6 @@ vorbis_dec_src_event (GstPad *pad, GstEvent *event)
break;
}
gst_event_unref (event);
return res;
}
static void
@ -302,7 +303,17 @@ vorbis_dec_chain (GstPad *pad, GstData *data)
return;
}
if (packet.packetno == 1) {
GstTagList *list = gst_tag_list_from_vorbiscomment_buffer (buf, "\003vorbis", 7, NULL);
gchar *encoder = NULL;
GstTagList *list = gst_tag_list_from_vorbiscomment_buffer (buf, "\003vorbis", 7, &encoder);
if (!list) {
GST_ERROR_OBJECT (vd, "couldn't decode comments");
list = gst_tag_list_new ();
}
if (encoder) {
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
GST_TAG_ENCODER, encoder, NULL);
g_free (encoder);
}
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
GST_TAG_ENCODER_VERSION, vd->vi.version, NULL);
if (vd->vi.bitrate_upper)
@ -310,7 +321,7 @@ vorbis_dec_chain (GstPad *pad, GstData *data)
GST_TAG_MAXIMUM_BITRATE, (guint) vd->vi.bitrate_upper, NULL);
if (vd->vi.bitrate_nominal)
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
GST_TAG_BITRATE, (guint) vd->vi.bitrate_nominal, NULL);
GST_TAG_NOMINAL_BITRATE, (guint) vd->vi.bitrate_nominal, NULL);
if (vd->vi.bitrate_lower)
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
GST_TAG_MINIMUM_BITRATE, (guint) vd->vi.bitrate_lower, NULL);

View file

@ -366,6 +366,7 @@ gst_tag_list_from_vorbiscomment_buffer (const GstBuffer *buffer, const guint8 *i
error:
gst_tag_list_free (list);
return NULL;
#undef ADVANCE
}
typedef struct {
guint count;