result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 100);
fail_unless (result == 100);
- /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 200);
- fail_unless (result == -1);
+ fail_unless (result == 200);
+ /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 300);
fail_unless (result == -1);
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 600);
fail_unless (result == 100);
- /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 700);
- fail_unless (result == -1);
+ fail_unless (result == 200);
+ /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 800);
fail_unless (result == -1);
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 600);
fail_unless (result == 300);
- /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 700);
- fail_unless (result == -1);
+ fail_unless (result == 400);
+ /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 800);
fail_unless (result == -1);
}
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 150);
fail_unless (result == 150);
- /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 200);
- fail_unless (result == -1);
+ fail_unless (result == 200);
+ /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 300);
fail_unless (result == -1);
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 250);
fail_unless (result == 150);
- /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 300);
- fail_unless (result == -1);
+ fail_unless (result == 200);
+ /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 400);
fail_unless (result == -1);
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 200);
fail_unless (result == 300);
- /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 300);
- fail_unless (result == -1);
+ fail_unless (result == 400);
+ /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 400);
fail_unless (result == -1);
}
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 150);
fail_unless (result == 50);
- /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 200);
- fail_unless (result == -1);
+ fail_unless (result == 0);
+ /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 300);
fail_unless (result == -1);
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 150);
fail_unless (result == 300);
- /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 200);
- fail_unless (result == -1);
+ fail_unless (result == 400);
+ /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 300);
fail_unless (result == -1);
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 150);
fail_unless (result == 100);
- /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 200);
- fail_unless (result == -1);
+ fail_unless (result == 0);
+ /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 300);
fail_unless (result == -1);
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 150);
fail_unless (result == 0);
- /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 200);
- fail_unless (result == -1);
+ fail_unless (result == 0);
+ /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 300);
fail_unless (result == -1);
}
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 150);
fail_unless (result == 300);
- /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 200);
- fail_unless (result == -1);
+ fail_unless (result == 400);
+ /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 300);
fail_unless (result == -1);
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 150);
fail_unless (result == 50);
- /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 200);
- fail_unless (result == -1);
+ fail_unless (result == 0);
+ /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 300);
fail_unless (result == -1);
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 150);
fail_unless (result == 50);
- /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 200);
- fail_unless (result == -1);
+ fail_unless (result == 0);
+ /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 300);
fail_unless (result == -1);
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 150);
fail_unless (result == 300);
- /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 200);
- fail_unless (result == -1);
+ fail_unless (result == 400);
+ /* outside of the segment */
result = gst_segment_to_stream_time (&segment, GST_FORMAT_TIME, 300);
fail_unless (result == -1);
}
result = gst_segment_to_running_time (&segment, GST_FORMAT_TIME, 100);
fail_unless (result == 100);
- /* outside of the segment */
+ /* at edge is exactly the segment duration */
result = gst_segment_to_running_time (&segment, GST_FORMAT_TIME, 200);
- fail_unless (result == -1);
+ fail_unless (result == 200);
+ /* outside of the segment */
result = gst_segment_to_running_time (&segment, GST_FORMAT_TIME, 300);
fail_unless (result == -1);
result = gst_segment_to_running_time (&segment, GST_FORMAT_TIME, 600);
fail_unless (result == 400);
- /* outside of the segment */
result = gst_segment_to_running_time (&segment, GST_FORMAT_TIME, 700);
- fail_unless (result == -1);
+ fail_unless (result == 500);
+ /* outside of the segment */
result = gst_segment_to_running_time (&segment, GST_FORMAT_TIME, 800);
fail_unless (result == -1);
result = gst_segment_to_running_time (&segment, GST_FORMAT_TIME, 600);
fail_unless (result == 600);
- /* outside of the segment */
result = gst_segment_to_running_time (&segment, GST_FORMAT_TIME, 700);
- fail_unless (result == -1);
+ fail_unless (result == 500);
+ /* outside of the segment */
result = gst_segment_to_running_time (&segment, GST_FORMAT_TIME, 800);
fail_unless (result == -1);
result = gst_segment_to_running_time (&segment, GST_FORMAT_TIME, 600);
fail_unless (result == 750);
- /* outside of the segment */
result = gst_segment_to_running_time (&segment, GST_FORMAT_TIME, 700);
- fail_unless (result == -1);
+ fail_unless (result == 700);
+ /* outside of the segment */
result = gst_segment_to_running_time (&segment, GST_FORMAT_TIME, 800);
fail_unless (result == -1);