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.
This commit is contained in:
parent
abe61f0d33
commit
0b3776c0b8
@ -1,3 +1,10 @@
|
|||||||
|
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>
|
2005-11-30 Thomas Vander Stichele <thomas (at) apestaart (dot) org>
|
||||||
|
|
||||||
* configure.ac:
|
* configure.ac:
|
||||||
|
@ -293,6 +293,7 @@ gst_dvdec_chain (GstPad * pad, GstBuffer * buf)
|
|||||||
outframe_pitches[2] = outframe_pitches[1];
|
outframe_pitches[2] = outframe_pitches[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (dvdec, "decoding and pushing buffer");
|
||||||
dv_decode_full_frame (dvdec->decoder, inframe,
|
dv_decode_full_frame (dvdec->decoder, inframe,
|
||||||
e_dv_color_yuv, outframe_ptrs, outframe_pitches);
|
e_dv_color_yuv, outframe_ptrs, outframe_pitches);
|
||||||
|
|
||||||
@ -310,6 +311,7 @@ skip:
|
|||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
no_buffer:
|
no_buffer:
|
||||||
{
|
{
|
||||||
|
GST_DEBUG_OBJECT (dvdec, "could not allocate buffer");
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
gst_object_unref (dvdec);
|
gst_object_unref (dvdec);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -882,9 +882,16 @@ gst_dvdemux_demux_frame (GstDVDemux * dvdemux, const guint8 * data)
|
|||||||
dvdemux->start_byte, &format, &dvdemux->start_timestamp))) {
|
dvdemux->start_byte, &format, &dvdemux->start_timestamp))) {
|
||||||
goto discont_error;
|
goto discont_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
dvdemux->timestamp = dvdemux->start_timestamp;
|
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) {
|
if (dvdemux->stop_byte == -1) {
|
||||||
dvdemux->stop_timestamp = -1;
|
dvdemux->stop_timestamp = -1;
|
||||||
} else {
|
} else {
|
||||||
@ -904,10 +911,9 @@ gst_dvdemux_demux_frame (GstDVDemux * dvdemux, const guint8 * data)
|
|||||||
dvdemux->need_discont = FALSE;
|
dvdemux->need_discont = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
dvdemux->total_frames++;
|
next_ts = gst_util_uint64_scale_int (
|
||||||
|
(dvdemux->total_frames + 1) * GST_SECOND,
|
||||||
next_ts = dvdemux->total_frames * GST_SECOND *
|
dvdemux->framerate_denominator, dvdemux->framerate_numerator);
|
||||||
dvdemux->framerate_denominator / dvdemux->framerate_numerator;
|
|
||||||
dvdemux->duration = next_ts - dvdemux->timestamp;
|
dvdemux->duration = next_ts - dvdemux->timestamp;
|
||||||
|
|
||||||
dv_parse_packs (dvdemux->decoder, data);
|
dv_parse_packs (dvdemux->decoder, data);
|
||||||
@ -929,6 +935,7 @@ gst_dvdemux_demux_frame (GstDVDemux * dvdemux, const guint8 * data)
|
|||||||
|
|
||||||
ret = GST_FLOW_OK;
|
ret = GST_FLOW_OK;
|
||||||
dvdemux->timestamp = next_ts;
|
dvdemux->timestamp = next_ts;
|
||||||
|
dvdemux->total_frames++;
|
||||||
|
|
||||||
done:
|
done:
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -73,7 +73,7 @@ struct _GstDVDemux {
|
|||||||
|
|
||||||
guint64 timestamp;
|
guint64 timestamp;
|
||||||
guint64 duration;
|
guint64 duration;
|
||||||
guint total_frames;
|
gint64 total_frames;
|
||||||
guint64 audio_offset;
|
guint64 audio_offset;
|
||||||
guint64 video_offset;
|
guint64 video_offset;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user