diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2009-09-23 14:25:08 +0200 |
---|---|---|
committer | Wim Taymans <wim@metal.(none)> | 2009-09-28 22:18:25 +0200 |
commit | 3f263edbbfa8d85bb659367cb9bbc547265f8de0 (patch) | |
tree | 2aa7013e191193dcbfa9ec992eebf6f1402eb47e | |
parent | 217315c20b136e90829b3f464f49d497546b09df (diff) |
avi: small cleanups
-rw-r--r-- | gst/avi/gstavidemux.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c index 9ec8d71df..96e3f9e8e 100644 --- a/gst/avi/gstavidemux.c +++ b/gst/avi/gstavidemux.c | |||
@@ -455,6 +455,7 @@ gst_avi_demux_handle_src_query (GstPad * pad, GstQuery * query) | |||
455 | GST_DEBUG ("pos query for stream %d: frames %d, bytes %" G_GUINT64_FORMAT, | 455 | GST_DEBUG ("pos query for stream %d: frames %d, bytes %" G_GUINT64_FORMAT, |
456 | stream->num, stream->current_entry, stream->current_total); | 456 | stream->num, stream->current_entry, stream->current_total); |
457 | 457 | ||
458 | /* FIXME, this looks clumsy */ | ||
458 | if (stream->strh->type == GST_RIFF_FCC_auds) { | 459 | if (stream->strh->type == GST_RIFF_FCC_auds) { |
459 | if (stream->is_vbr) { | 460 | if (stream->is_vbr) { |
460 | /* VBR */ | 461 | /* VBR */ |
@@ -4000,29 +4001,35 @@ static void | |||
4000 | push_tag_lists (GstAviDemux * avi) | 4001 | push_tag_lists (GstAviDemux * avi) |
4001 | { | 4002 | { |
4002 | guint i; | 4003 | guint i; |
4004 | GstTagList *tags; | ||
4003 | 4005 | ||
4004 | if (!avi->got_tags) | 4006 | if (!avi->got_tags) |
4005 | return; | 4007 | return; |
4006 | 4008 | ||
4007 | GST_DEBUG_OBJECT (avi, "Pushing pending tag lists"); | 4009 | GST_DEBUG_OBJECT (avi, "Pushing pending tag lists"); |
4008 | 4010 | ||
4009 | for (i = 0; i < avi->num_streams; i++) | 4011 | for (i = 0; i < avi->num_streams; i++) { |
4010 | if (avi->stream[i].pad && avi->stream[i].taglist) { | 4012 | GstAviStream *stream = &avi->stream[i]; |
4011 | GST_DEBUG_OBJECT (avi->stream[i].pad, "Tags: %" GST_PTR_FORMAT, | 4013 | GstPad *pad = stream->pad; |
4012 | avi->stream[i].taglist); | 4014 | |
4013 | gst_element_found_tags_for_pad (GST_ELEMENT (avi), avi->stream[i].pad, | 4015 | tags = stream->taglist; |
4014 | avi->stream[i].taglist); | 4016 | |
4015 | avi->stream[i].taglist = NULL; | 4017 | if (pad && tags) { |
4018 | GST_DEBUG_OBJECT (pad, "Tags: %" GST_PTR_FORMAT, tags); | ||
4019 | |||
4020 | gst_element_found_tags_for_pad (GST_ELEMENT_CAST (avi), pad, tags); | ||
4021 | stream->taglist = NULL; | ||
4016 | } | 4022 | } |
4023 | } | ||
4017 | 4024 | ||
4018 | if (avi->globaltags == NULL) | 4025 | if (!(tags = avi->globaltags)) |
4019 | avi->globaltags = gst_tag_list_new (); | 4026 | tags = gst_tag_list_new (); |
4020 | 4027 | ||
4021 | gst_tag_list_add (avi->globaltags, GST_TAG_MERGE_REPLACE, | 4028 | gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE, |
4022 | GST_TAG_CONTAINER_FORMAT, "AVI", NULL); | 4029 | GST_TAG_CONTAINER_FORMAT, "AVI", NULL); |
4023 | 4030 | ||
4024 | GST_DEBUG_OBJECT (avi, "Global tags: %" GST_PTR_FORMAT, avi->globaltags); | 4031 | GST_DEBUG_OBJECT (avi, "Global tags: %" GST_PTR_FORMAT, tags); |
4025 | gst_element_found_tags (GST_ELEMENT (avi), avi->globaltags); | 4032 | gst_element_found_tags (GST_ELEMENT_CAST (avi), tags); |
4026 | avi->globaltags = NULL; | 4033 | avi->globaltags = NULL; |
4027 | avi->got_tags = FALSE; | 4034 | avi->got_tags = FALSE; |
4028 | } | 4035 | } |
@@ -4035,16 +4042,16 @@ gst_avi_demux_loop (GstPad * pad) | |||
4035 | 4042 | ||
4036 | switch (avi->state) { | 4043 | switch (avi->state) { |
4037 | case GST_AVI_DEMUX_START: | 4044 | case GST_AVI_DEMUX_START: |
4038 | if (G_UNLIKELY ((res = | 4045 | res = gst_avi_demux_stream_init_pull (avi); |
4039 | gst_avi_demux_stream_init_pull (avi)) != GST_FLOW_OK)) { | 4046 | if (G_UNLIKELY (res != GST_FLOW_OK)) { |
4040 | GST_WARNING ("stream_init flow: %s", gst_flow_get_name (res)); | 4047 | GST_WARNING ("stream_init flow: %s", gst_flow_get_name (res)); |
4041 | goto pause; | 4048 | goto pause; |
4042 | } | 4049 | } |
4043 | avi->state = GST_AVI_DEMUX_HEADER; | 4050 | avi->state = GST_AVI_DEMUX_HEADER; |
4044 | /* fall-through */ | 4051 | /* fall-through */ |
4045 | case GST_AVI_DEMUX_HEADER: | 4052 | case GST_AVI_DEMUX_HEADER: |
4046 | if (G_UNLIKELY ((res = | 4053 | res = gst_avi_demux_stream_header_pull (avi); |
4047 | gst_avi_demux_stream_header_pull (avi)) != GST_FLOW_OK)) { | 4054 | if (G_UNLIKELY (res != GST_FLOW_OK)) { |
4048 | GST_WARNING ("stream_header flow: %s", gst_flow_get_name (res)); | 4055 | GST_WARNING ("stream_header flow: %s", gst_flow_get_name (res)); |
4049 | goto pause; | 4056 | goto pause; |
4050 | } | 4057 | } |