mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
- Parse strn tag
Original commit message from CVS: - Parse strn tag - fix flush
This commit is contained in:
parent
7fc99d04b1
commit
eee282c521
1 changed files with 32 additions and 2 deletions
|
@ -385,6 +385,20 @@ gst_avi_demux_dmlh (GstAviDemux *avi_demux)
|
||||||
got_bytes = gst_bytestream_peek_bytes (bs, (guint8 **)&dmlh, sizeof (gst_riff_dmlh));
|
got_bytes = gst_bytestream_peek_bytes (bs, (guint8 **)&dmlh, sizeof (gst_riff_dmlh));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gst_avi_demux_strn (GstAviDemux *avi_demux, gint len)
|
||||||
|
{
|
||||||
|
gchar *name;
|
||||||
|
GstByteStream *bs = avi_demux->bs;
|
||||||
|
guint32 got_bytes;
|
||||||
|
|
||||||
|
got_bytes = gst_bytestream_peek_bytes (bs, (guint8 **)&name, len);
|
||||||
|
if (got_bytes != len)
|
||||||
|
return;
|
||||||
|
|
||||||
|
GST_DEBUG (0, "Stream name: \"%s\"", name);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_avi_demux_strf_vids (GstAviDemux *avi_demux)
|
gst_avi_demux_strf_vids (GstAviDemux *avi_demux)
|
||||||
{
|
{
|
||||||
|
@ -1141,6 +1155,7 @@ gst_avi_demux_handle_sink_event (GstAviDemux *avi_demux)
|
||||||
gst_bytestream_get_status (avi_demux->bs, &remaining, &event);
|
gst_bytestream_get_status (avi_demux->bs, &remaining, &event);
|
||||||
|
|
||||||
type = event? GST_EVENT_TYPE (event) : GST_EVENT_UNKNOWN;
|
type = event? GST_EVENT_TYPE (event) : GST_EVENT_UNKNOWN;
|
||||||
|
GST_DEBUG (0, "avidemux: event %p %d", event, type);
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case GST_EVENT_EOS:
|
case GST_EVENT_EOS:
|
||||||
|
@ -1315,6 +1330,9 @@ gst_avi_demux_loop (GstElement *element)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case GST_RIFF_TAG_strn:
|
||||||
|
gst_avi_demux_strn (avi_demux, chunk.size);
|
||||||
|
break;
|
||||||
case GST_RIFF_TAG_dmlh:
|
case GST_RIFF_TAG_dmlh:
|
||||||
gst_avi_demux_dmlh (avi_demux);
|
gst_avi_demux_dmlh (avi_demux);
|
||||||
break;
|
break;
|
||||||
|
@ -1394,8 +1412,20 @@ gst_avi_demux_loop (GstElement *element)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flush)
|
while (flush) {
|
||||||
gst_bytestream_flush (avi_demux->bs, flush);
|
gboolean res;
|
||||||
|
|
||||||
|
res = gst_bytestream_flush (avi_demux->bs, flush);
|
||||||
|
if (!res) {
|
||||||
|
guint32 remaining;
|
||||||
|
GstEvent *event;
|
||||||
|
|
||||||
|
gst_bytestream_get_status (avi_demux->bs, &remaining, &event);
|
||||||
|
gst_event_unref (event);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstElementStateReturn
|
static GstElementStateReturn
|
||||||
|
|
Loading…
Reference in a new issue