gst_query_set_formats (query, 3,
GST_FORMAT_TIME, GST_FORMAT_BYTES, GST_FORMAT_DEFAULT);
break;
- case GST_QUERY_SEGMENT:
- gst_query_set_segment (query, timidity->o_segment->rate,
- timidity->o_segment->format, timidity->o_segment->start,
- timidity->o_segment->stop);
+ case GST_QUERY_SEGMENT:{
+ GstFormat format;
+ gint64 start, stop;
+
+ format = timidity->o_segment->format;
+
+ start =
+ gst_segment_to_stream_time (timidity->o_segment, format,
+ timidity->o_segment->start);
+ if ((stop = timidity->o_segment->stop) == -1)
+ stop = timidity->o_segment->duration;
+ else
+ stop = gst_segment_to_stream_time (timidity->o_segment, format, stop);
+
+ gst_query_set_segment (query, timidity->o_segment->rate, format, start,
+ stop);
+ res = TRUE;
break;
+ }
case GST_QUERY_SEEKING:
gst_query_set_seeking (query, timidity->o_segment->format,
TRUE, 0, timidity->o_len);
gst_query_set_formats (query, 3,
GST_FORMAT_TIME, GST_FORMAT_BYTES, GST_FORMAT_DEFAULT);
break;
- case GST_QUERY_SEGMENT:
- gst_query_set_segment (query, wildmidi->o_segment->rate,
- wildmidi->o_segment->format, wildmidi->o_segment->start,
- wildmidi->o_segment->stop);
+ case GST_QUERY_SEGMENT:{
+ GstFormat format;
+ gint64 start, stop;
+
+ format = wildmidi->o_segment->format;
+
+ start =
+ gst_segment_to_stream_time (wildmidi->o_segment, format,
+ wildmidi->o_segment->start);
+ if ((stop = wildmidi->o_segment->stop) == -1)
+ stop = wildmidi->o_segment->duration;
+ else
+ stop = gst_segment_to_stream_time (wildmidi->o_segment, format, stop);
+
+ gst_query_set_segment (query, wildmidi->o_segment->rate, format, start,
+ stop);
+ res = TRUE;
break;
+ }
case GST_QUERY_SEEKING:
gst_query_set_seeking (query, wildmidi->o_segment->format,
TRUE, 0, wildmidi->o_len);
case GST_QUERY_FORMATS:
gst_query_set_formats (query, 1, GST_FORMAT_TIME);
break;
- case GST_QUERY_SEGMENT:
- gst_query_set_segment (query, midiparse->segment.rate,
- midiparse->segment.format, midiparse->segment.start,
- midiparse->segment.stop);
+ case GST_QUERY_SEGMENT:{
+ GstFormat format;
+ gint64 start, stop;
+
+ format = midiparse->segment.format;
+
+ start =
+ gst_segment_to_stream_time (&midiparse->segment, format,
+ midiparse->segment.start);
+ if ((stop = midiparse->segment.stop) == -1)
+ stop = midiparse->segment.duration;
+ else
+ stop = gst_segment_to_stream_time (&midiparse->segment, format, stop);
+
+ gst_query_set_segment (query, midiparse->segment.rate, format, start,
+ stop);
+ res = TRUE;
break;
+ }
case GST_QUERY_SEEKING:
gst_query_set_seeking (query, midiparse->segment.format,
FALSE, 0, midiparse->segment.duration);