+2005-11-30 Wim Taymans <wim@fluendo.com>
+
+ * ext/dv/gstdvdec.c: (gst_dvdec_chain):
+ * ext/dv/gstdvdemux.c: (gst_dvdemux_demux_frame):
+ * ext/dv/gstdvdemux.h:
+ Fix seeking in dvdemux again, add some more debug info.
+
2005-11-30 Thomas Vander Stichele <thomas (at) apestaart (dot) org>
* configure.ac:
outframe_pitches[2] = outframe_pitches[1];
}
+ GST_DEBUG_OBJECT (dvdec, "decoding and pushing buffer");
dv_decode_full_frame (dvdec->decoder, inframe,
e_dv_color_yuv, outframe_ptrs, outframe_pitches);
/* ERRORS */
no_buffer:
{
+ GST_DEBUG_OBJECT (dvdec, "could not allocate buffer");
gst_buffer_unref (buf);
gst_object_unref (dvdec);
return ret;
dvdemux->start_byte, &format, &dvdemux->start_timestamp))) {
goto discont_error;
}
-
dvdemux->timestamp = dvdemux->start_timestamp;
+ /* calculate current frame number */
+ format = GST_FORMAT_DEFAULT;
+ if (!(res = gst_pad_query_convert (dvdemux->videosrcpad,
+ GST_FORMAT_TIME,
+ dvdemux->start_timestamp, &format, &dvdemux->total_frames))) {
+ goto discont_error;
+ }
+
if (dvdemux->stop_byte == -1) {
dvdemux->stop_timestamp = -1;
} else {
dvdemux->need_discont = FALSE;
}
- dvdemux->total_frames++;
-
- next_ts = dvdemux->total_frames * GST_SECOND *
- dvdemux->framerate_denominator / dvdemux->framerate_numerator;
+ next_ts = gst_util_uint64_scale_int (
+ (dvdemux->total_frames + 1) * GST_SECOND,
+ dvdemux->framerate_denominator, dvdemux->framerate_numerator);
dvdemux->duration = next_ts - dvdemux->timestamp;
dv_parse_packs (dvdemux->decoder, data);
ret = GST_FLOW_OK;
dvdemux->timestamp = next_ts;
+ dvdemux->total_frames++;
done:
return ret;