mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-21 07:46:38 +00:00
gst/flv/gstflvdemux.c: Fix non key unit seeking by always going to the previous keyframe. Mark the discont flag when ...
Original commit message from CVS: 2008-11-24 Julien Moutte <julien@fluendo.com> * gst/flv/gstflvdemux.c: (gst_flv_demux_find_offset), (gst_flv_demux_handle_seek_push), (gst_flv_demux_handle_seek_pull): Fix non key unit seeking by always going to the previous keyframe. Mark the discont flag when we've moved in the file. * gst/flv/gstflvparse.c: (gst_flv_parse_audio_negotiate): MP3 streams are parsed already, makes autoplugged pipelines shorter.
This commit is contained in:
parent
2082d618f9
commit
25a21ecdef
3 changed files with 20 additions and 4 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2008-11-24 Julien Moutte <julien@fluendo.com>
|
||||||
|
|
||||||
|
* gst/flv/gstflvdemux.c: (gst_flv_demux_find_offset),
|
||||||
|
(gst_flv_demux_handle_seek_push), (gst_flv_demux_handle_seek_pull):
|
||||||
|
Fix non key unit seeking by always going to the previous keyframe. Mark
|
||||||
|
the discont flag when we've moved in the file.
|
||||||
|
* gst/flv/gstflvparse.c: (gst_flv_parse_audio_negotiate): MP3 streams
|
||||||
|
are parsed already, makes autoplugged pipelines shorter.
|
||||||
|
|
||||||
2008-11-24 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
2008-11-24 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
||||||
|
|
||||||
Patch by: vanista <vanista at gmail dot com>
|
Patch by: vanista <vanista at gmail dot com>
|
||||||
|
|
|
@ -612,9 +612,7 @@ gst_flv_demux_find_offset (GstFLVDemux * demux, GstSegment * segment)
|
||||||
if (demux->index) {
|
if (demux->index) {
|
||||||
/* Let's check if we have an index entry for that seek time */
|
/* Let's check if we have an index entry for that seek time */
|
||||||
entry = gst_index_get_assoc_entry (demux->index, demux->index_id,
|
entry = gst_index_get_assoc_entry (demux->index, demux->index_id,
|
||||||
GST_INDEX_LOOKUP_BEFORE,
|
GST_INDEX_LOOKUP_BEFORE, GST_ASSOCIATION_FLAG_KEY_UNIT,
|
||||||
(segment->flags & GST_SEEK_FLAG_KEY_UNIT) ?
|
|
||||||
GST_ASSOCIATION_FLAG_KEY_UNIT : GST_ASSOCIATION_FLAG_NONE,
|
|
||||||
GST_FORMAT_TIME, time);
|
GST_FORMAT_TIME, time);
|
||||||
|
|
||||||
if (entry) {
|
if (entry) {
|
||||||
|
@ -688,6 +686,10 @@ gst_flv_demux_handle_seek_push (GstFLVDemux * demux, GstEvent * event)
|
||||||
if (G_UNLIKELY (!ret)) {
|
if (G_UNLIKELY (!ret)) {
|
||||||
GST_WARNING_OBJECT (demux, "upstream seek failed");
|
GST_WARNING_OBJECT (demux, "upstream seek failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Tell all the stream we moved to a different position (discont) */
|
||||||
|
demux->audio_need_discont = TRUE;
|
||||||
|
demux->video_need_discont = TRUE;
|
||||||
} else {
|
} else {
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -777,6 +779,10 @@ gst_flv_demux_handle_seek_pull (GstFLVDemux * demux, GstEvent * event)
|
||||||
/* Do the actual seeking */
|
/* Do the actual seeking */
|
||||||
demux->offset = gst_flv_demux_find_offset (demux, &seeksegment);
|
demux->offset = gst_flv_demux_find_offset (demux, &seeksegment);
|
||||||
|
|
||||||
|
/* Tell all the stream we moved to a different position (discont) */
|
||||||
|
demux->audio_need_discont = TRUE;
|
||||||
|
demux->video_need_discont = TRUE;
|
||||||
|
|
||||||
/* If we seeked at the beginning of the file parse the header again */
|
/* If we seeked at the beginning of the file parse the header again */
|
||||||
if (G_UNLIKELY (!demux->offset)) {
|
if (G_UNLIKELY (!demux->offset)) {
|
||||||
demux->state = FLV_STATE_HEADER;
|
demux->state = FLV_STATE_HEADER;
|
||||||
|
|
|
@ -393,7 +393,8 @@ gst_flv_parse_audio_negotiate (GstFLVDemux * demux, guint32 codec_tag,
|
||||||
case 2:
|
case 2:
|
||||||
case 14:
|
case 14:
|
||||||
caps = gst_caps_new_simple ("audio/mpeg",
|
caps = gst_caps_new_simple ("audio/mpeg",
|
||||||
"mpegversion", G_TYPE_INT, 1, "layer", G_TYPE_INT, 3, NULL);
|
"mpegversion", G_TYPE_INT, 1, "layer", G_TYPE_INT, 3,
|
||||||
|
"parsed", G_TYPE_BOOLEAN, TRUE, NULL);
|
||||||
codec_name = "MPEG 1 Audio, Layer 3 (MP3)";
|
codec_name = "MPEG 1 Audio, Layer 3 (MP3)";
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
|
|
Loading…
Reference in a new issue