mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-05 06:58:49 +00:00
Bigendian fixes
Original commit message from CVS: Bigendian fixes
This commit is contained in:
parent
2fe0c7b83e
commit
d3ebdad0b1
1 changed files with 20 additions and 12 deletions
|
@ -918,8 +918,10 @@ gst_avi_demux_strf_iavs (GstAviDemux *avi_demux)
|
||||||
static void
|
static void
|
||||||
gst_avi_debug_entry (const gchar *prefix, gst_avi_index_entry *entry)
|
gst_avi_debug_entry (const gchar *prefix, gst_avi_index_entry *entry)
|
||||||
{
|
{
|
||||||
GST_DEBUG (0, "%s: %05d %d %08llx %05d %14" G_GINT64_FORMAT " %08x %08x (%d) %08x", prefix, entry->index_nr, entry->stream_nr,
|
GST_DEBUG (0, "%s: %05d %d %08llx %05d %14" G_GINT64_FORMAT " %08x %08x (%d) %08x",
|
||||||
(unsigned long long)entry->bytes_before, entry->frames_before, entry->ts, entry->flags, entry->offset,
|
prefix, entry->index_nr, entry->stream_nr,
|
||||||
|
(unsigned long long)entry->bytes_before,
|
||||||
|
entry->frames_before, entry->ts, entry->flags, entry->offset,
|
||||||
entry->offset, entry->size);
|
entry->offset, entry->size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -986,8 +988,10 @@ gst_avi_demux_parse_index (GstAviDemux *avi_demux,
|
||||||
gint stream_nr;
|
gint stream_nr;
|
||||||
gst_avi_index_entry *target = &avi_demux->index_entries[i];
|
gst_avi_index_entry *target = &avi_demux->index_entries[i];
|
||||||
GstFormat format;
|
GstFormat format;
|
||||||
|
guint32 id;
|
||||||
|
|
||||||
stream_nr = CHUNKID_TO_STREAMNR (entry[i].id);
|
id = GUINT32_FROM_LE (entry[i].id);
|
||||||
|
stream_nr = CHUNKID_TO_STREAMNR (id);
|
||||||
if (stream_nr > avi_demux->num_streams || stream_nr < 0) {
|
if (stream_nr > avi_demux->num_streams || stream_nr < 0) {
|
||||||
avi_demux->index_entries[i].stream_nr = -1;
|
avi_demux->index_entries[i].stream_nr = -1;
|
||||||
continue;
|
continue;
|
||||||
|
@ -997,9 +1001,9 @@ gst_avi_demux_parse_index (GstAviDemux *avi_demux,
|
||||||
stream = &avi_demux->stream[stream_nr];
|
stream = &avi_demux->stream[stream_nr];
|
||||||
|
|
||||||
target->index_nr = i;
|
target->index_nr = i;
|
||||||
target->flags = entry[i].flags;
|
target->flags = GUINT32_FROM_LE (entry[i].flags);
|
||||||
target->size = entry[i].size;
|
target->size = GUINT32_FROM_LE (entry[i].size);
|
||||||
target->offset = entry[i].offset;
|
target->offset = GUINT32_FROM_LE (entry[i].offset);
|
||||||
|
|
||||||
/* figure out if the index is 0 based or relative to the MOVI start */
|
/* figure out if the index is 0 based or relative to the MOVI start */
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
|
@ -1424,10 +1428,12 @@ gst_avi_demux_handle_sink_event (GstAviDemux *avi_demux)
|
||||||
avi_stream_context *stream = &avi_demux->stream[i];
|
avi_stream_context *stream = &avi_demux->stream[i];
|
||||||
|
|
||||||
if (GST_PAD_IS_USABLE (stream->pad)) {
|
if (GST_PAD_IS_USABLE (stream->pad)) {
|
||||||
GST_DEBUG (GST_CAT_EVENT, "sending discont on %d %" G_GINT64_FORMAT " + %" G_GINT64_FORMAT " = %" G_GINT64_FORMAT, i,
|
GST_DEBUG (GST_CAT_EVENT, "sending discont on %d %" G_GINT64_FORMAT " + %" G_GINT64_FORMAT " = %" G_GINT64_FORMAT,
|
||||||
avi_demux->last_seek, stream->delay, avi_demux->last_seek + stream->delay);
|
i, avi_demux->last_seek, stream->delay, avi_demux->last_seek + stream->delay);
|
||||||
|
|
||||||
discont = gst_event_new_discontinuous (FALSE, GST_FORMAT_TIME,
|
discont = gst_event_new_discontinuous (FALSE, GST_FORMAT_TIME,
|
||||||
avi_demux->last_seek + stream->delay , NULL);
|
avi_demux->last_seek + stream->delay , NULL);
|
||||||
|
|
||||||
gst_pad_push (stream->pad, GST_BUFFER (discont));
|
gst_pad_push (stream->pad, GST_BUFFER (discont));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1634,7 +1640,8 @@ gst_avi_demux_loop (GstElement *element)
|
||||||
if (GST_PAD_IS_USABLE (stream->pad)) {
|
if (GST_PAD_IS_USABLE (stream->pad)) {
|
||||||
if (next_ts >= stream->end_pos) {
|
if (next_ts >= stream->end_pos) {
|
||||||
gst_pad_push (stream->pad, GST_BUFFER (gst_event_new (GST_EVENT_EOS)));
|
gst_pad_push (stream->pad, GST_BUFFER (gst_event_new (GST_EVENT_EOS)));
|
||||||
GST_DEBUG (0, "end stream %d: %" G_GINT64_FORMAT " %d %" G_GINT64_FORMAT, stream_id, next_ts, stream->current_frame - 1,
|
GST_DEBUG (0, "end stream %d: %" G_GINT64_FORMAT " %d %" G_GINT64_FORMAT,
|
||||||
|
stream_id, next_ts, stream->current_frame - 1,
|
||||||
stream->end_pos);
|
stream->end_pos);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1650,7 +1657,8 @@ gst_avi_demux_loop (GstElement *element)
|
||||||
/* FIXME, do some flush event here */
|
/* FIXME, do some flush event here */
|
||||||
stream->need_flush = FALSE;
|
stream->need_flush = FALSE;
|
||||||
}
|
}
|
||||||
GST_DEBUG (0, "send stream %d: %" G_GINT64_FORMAT " %d %" G_GINT64_FORMAT " %08x", stream_id, next_ts, stream->current_frame - 1,
|
GST_DEBUG (0, "send stream %d: %" G_GINT64_FORMAT " %d %" G_GINT64_FORMAT " %08x",
|
||||||
|
stream_id, next_ts, stream->current_frame - 1,
|
||||||
stream->delay, chunk.size);
|
stream->delay, chunk.size);
|
||||||
|
|
||||||
gst_pad_push(stream->pad, buf);
|
gst_pad_push(stream->pad, buf);
|
||||||
|
|
Loading…
Reference in a new issue