Added segment seek
Original commit message from CVS: Added segment seek
This commit is contained in:
parent
bb4952c055
commit
ea619028c7
@ -369,6 +369,7 @@ gst_avi_demux_strh (GstAviDemux *avi_demux)
|
||||
target->delay = 0LL;
|
||||
target->total_bytes = 0LL;
|
||||
target->total_frames = 0;
|
||||
target->end_pos = -1;
|
||||
|
||||
target->skip = 0;
|
||||
|
||||
@ -1032,6 +1033,7 @@ gst_avi_demux_get_event_mask (GstPad *pad)
|
||||
{
|
||||
static const GstEventMask masks[] = {
|
||||
{ GST_EVENT_SEEK, GST_SEEK_METHOD_SET | GST_SEEK_FLAG_KEY_UNIT },
|
||||
{ GST_EVENT_SEEK_SEGMENT, GST_SEEK_METHOD_SET | GST_SEEK_FLAG_KEY_UNIT },
|
||||
{ 0, }
|
||||
};
|
||||
|
||||
@ -1048,6 +1050,8 @@ gst_avi_demux_handle_src_event (GstPad *pad, GstEvent *event)
|
||||
stream = gst_pad_get_element_private (pad);
|
||||
|
||||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_SEEK_SEGMENT:
|
||||
stream->end_pos = GST_EVENT_SEEK_ENDOFFSET (event);
|
||||
case GST_EVENT_SEEK:
|
||||
GST_DEBUG (0, "seek format %d, %08x", GST_EVENT_SEEK_FORMAT (event), stream->strh.type);
|
||||
switch (GST_EVENT_SEEK_FORMAT (event)) {
|
||||
@ -1061,11 +1065,13 @@ gst_avi_demux_handle_src_event (GstPad *pad, GstEvent *event)
|
||||
guint32 flags;
|
||||
guint64 min_index;
|
||||
|
||||
|
||||
/* no seek on audio yet */
|
||||
if (stream->strh.type == GST_RIFF_FCC_auds) {
|
||||
res = FALSE;
|
||||
goto done;
|
||||
}
|
||||
GST_DEBUG (0, "seeking to %lld", desired_offset);
|
||||
|
||||
flags = GST_RIFF_IF_KEYFRAME;
|
||||
|
||||
@ -1347,7 +1353,13 @@ gst_avi_demux_process_chunk (GstAviDemux *avi_demux, guint64 *filepos,
|
||||
stream->skip--;
|
||||
}
|
||||
else {
|
||||
if (stream->pad && GST_PAD_IS_CONNECTED (stream->pad)) {
|
||||
if (GST_PAD_IS_USABLE (stream->pad)) {
|
||||
if (next_ts >= stream->end_pos) {
|
||||
gst_pad_push (stream->pad, GST_BUFFER (gst_event_new (GST_EVENT_EOS)));
|
||||
GST_DEBUG (0, "end stream %d: %lld %d %lld", stream_id, next_ts, stream->current_frame - 1,
|
||||
stream->end_pos);
|
||||
}
|
||||
else {
|
||||
GstBuffer *buf;
|
||||
guint32 got_bytes;
|
||||
|
||||
@ -1367,6 +1379,7 @@ gst_avi_demux_process_chunk (GstAviDemux *avi_demux, guint64 *filepos,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*chunksize = (*chunksize + 1) & ~1;
|
||||
break;
|
||||
|
@ -74,6 +74,7 @@ typedef struct
|
||||
guint64 delay;
|
||||
gboolean need_flush;
|
||||
guint32 av_bps;
|
||||
guint64 end_pos;
|
||||
|
||||
guint64 total_bytes;
|
||||
guint32 total_frames;
|
||||
|
Loading…
x
Reference in New Issue
Block a user