index: use delta frame flags instead of 0 or none

This commit is contained in:
Stefan Kost 2011-02-17 18:05:58 +02:00
parent 0d20df6d2b
commit 9424c553b9
3 changed files with 8 additions and 4 deletions

View file

@ -1676,7 +1676,8 @@ gst_mad_chain (GstPad * pad, GstBuffer * buffer)
if (mad->index) { if (mad->index) {
guint64 x_bytes = mad->base_byte_offset + mad->bytes_consumed; guint64 x_bytes = mad->base_byte_offset + mad->bytes_consumed;
gst_index_add_association (mad->index, mad->index_id, 0, gst_index_add_association (mad->index, mad->index_id,
GST_ASSOCIATION_FLAG_DELTA_UNIT,
GST_FORMAT_BYTES, x_bytes, GST_FORMAT_TIME, time_offset, NULL); GST_FORMAT_BYTES, x_bytes, GST_FORMAT_TIME, time_offset, NULL);
} }
#endif #endif

View file

@ -890,7 +890,8 @@ handle_slice (GstMpeg2dec * mpeg2dec, const mpeg2_info_t * info)
#ifndef GST_DISABLE_INDEX #ifndef GST_DISABLE_INDEX
if (mpeg2dec->index) { if (mpeg2dec->index) {
gst_index_add_association (mpeg2dec->index, mpeg2dec->index_id, gst_index_add_association (mpeg2dec->index, mpeg2dec->index_id,
(key_frame ? GST_ASSOCIATION_FLAG_KEY_UNIT : 0), (key_frame ? GST_ASSOCIATION_FLAG_KEY_UNIT :
GST_ASSOCIATION_FLAG_DELTA_UNIT),
GST_FORMAT_BYTES, GST_BUFFER_OFFSET (outbuf), GST_FORMAT_BYTES, GST_BUFFER_OFFSET (outbuf),
GST_FORMAT_TIME, GST_BUFFER_TIMESTAMP (outbuf), 0); GST_FORMAT_TIME, GST_BUFFER_TIMESTAMP (outbuf), 0);
} }

View file

@ -1030,9 +1030,11 @@ gst_mpeg_demux_send_subbuffer (GstMPEGDemux * mpeg_demux,
outstream->scr_offs = 0; outstream->scr_offs = 0;
if (mpeg_demux->index != NULL) { if (mpeg_demux->index != NULL) {
/* Register a new index position. */ /* Register a new index position.
* FIXME: check for keyframes
*/
gst_index_add_association (mpeg_demux->index, gst_index_add_association (mpeg_demux->index,
outstream->index_id, 0, outstream->index_id, GST_ASSOCIATION_FLAG_DELTA_UNIT,
GST_FORMAT_BYTES, GST_FORMAT_BYTES,
GST_BUFFER_OFFSET (buffer), GST_FORMAT_TIME, timestamp, 0); GST_BUFFER_OFFSET (buffer), GST_FORMAT_TIME, timestamp, 0);
} }