Commit 0b3776c0 authored by Wim Taymans's avatar Wim Taymans
Browse files

ext/dv/: Fix seeking in dvdemux again, add some more debug info.

Original commit message from CVS:
* 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.
parent abe61f0d
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:
......
......@@ -293,6 +293,7 @@ gst_dvdec_chain (GstPad * pad, GstBuffer * buf)
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);
......@@ -310,6 +311,7 @@ skip:
/* ERRORS */
no_buffer:
{
GST_DEBUG_OBJECT (dvdec, "could not allocate buffer");
gst_buffer_unref (buf);
gst_object_unref (dvdec);
return ret;
......
......@@ -882,9 +882,16 @@ gst_dvdemux_demux_frame (GstDVDemux * dvdemux, const guint8 * data)
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 {
......@@ -904,10 +911,9 @@ gst_dvdemux_demux_frame (GstDVDemux * dvdemux, const guint8 * data)
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);
......@@ -929,6 +935,7 @@ gst_dvdemux_demux_frame (GstDVDemux * dvdemux, const guint8 * data)
ret = GST_FLOW_OK;
dvdemux->timestamp = next_ts;
dvdemux->total_frames++;
done:
return ret;
......
......@@ -73,7 +73,7 @@ struct _GstDVDemux {
guint64 timestamp;
guint64 duration;
guint total_frames;
gint64 total_frames;
guint64 audio_offset;
guint64 video_offset;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment