avidemux: Use first indexed stream for seeking.

In the future, main_stream can be adjusted to contain the optimal stream
as mentionned in the FIXME line 3440
This commit is contained in:
Edward Hervey 2009-10-18 15:48:06 +02:00
parent 2110cbe556
commit af99a4a1de
2 changed files with 6 additions and 1 deletions

View file

@ -263,6 +263,7 @@ gst_avi_demux_reset (GstAviDemux * avi)
avi->num_v_streams = 0; avi->num_v_streams = 0;
avi->num_a_streams = 0; avi->num_a_streams = 0;
avi->num_t_streams = 0; avi->num_t_streams = 0;
avi->main_stream = -1;
avi->state = GST_AVI_DEMUX_START; avi->state = GST_AVI_DEMUX_START;
avi->offset = 0; avi->offset = 0;
@ -1663,6 +1664,8 @@ gst_avi_demux_expose_streams (GstAviDemux * avi, gboolean force)
GST_PAD_NAME (stream->pad), GST_PAD_CAPS (stream->pad)); GST_PAD_NAME (stream->pad), GST_PAD_CAPS (stream->pad));
gst_element_add_pad ((GstElement *) avi, stream->pad); gst_element_add_pad ((GstElement *) avi, stream->pad);
stream->exposed = TRUE; stream->exposed = TRUE;
if (avi->main_stream == -1)
avi->main_stream = i;
} else { } else {
GST_WARNING_OBJECT (avi, "Stream #%d doesn't have any entry, removing it", GST_WARNING_OBJECT (avi, "Stream #%d doesn't have any entry, removing it",
i); i);
@ -3441,7 +3444,7 @@ gst_avi_demux_do_seek (GstAviDemux * avi, GstSegment * segment)
/* FIXME, this code assumes the main stream with keyframes is stream 0, /* FIXME, this code assumes the main stream with keyframes is stream 0,
* which is mostly correct... */ * which is mostly correct... */
stream = &avi->stream[0]; stream = &avi->stream[avi->main_stream];
/* get the entry index for the requested position */ /* get the entry index for the requested position */
index = gst_avi_demux_index_for_time (avi, stream, seek_time); index = gst_avi_demux_index_for_time (avi, stream, seek_time);

View file

@ -164,6 +164,8 @@ typedef struct _GstAviDemux {
guint num_a_streams; guint num_a_streams;
guint num_t_streams; /* subtitle text streams */ guint num_t_streams; /* subtitle text streams */
guint main_stream; /* used for seeking */
/* for streaming mode */ /* for streaming mode */
gboolean streaming; gboolean streaming;
gboolean have_eos; gboolean have_eos;