From f39449ebd2cd43aee7a669d440c0bb303863951a Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Tue, 12 Apr 2005 05:10:37 +0000 Subject: ext/dts/gstdtsdec.c: Handle filler events. Original commit message from CVS: * ext/dts/gstdtsdec.c: (gst_dtsdec_handle_event), (gst_dtsdec_chain): Handle filler events. * ext/a52dec/gsta52dec.c: (gst_a52dec_handle_event), (gst_a52dec_chain): Handle filler events. * ext/dvdnav/dvdnavsrc.c: (dvdnavsrc_init), (dvdnavsrc_print_event), (dvdnavsrc_structure_set_uint64), (dvdnavsrc_make_dvd_nav_packet_event), (dvdnavsrc_loop), (dvdnavsrc_change_state), (dvdnav_handle_navigation_event), (dvdnavsrc_event), (dvdnavsrc_get_formats), (dvdnavsrc_query): Lots of changes for DVD playback * ext/ladspa/gstladspa.c: (gst_ladspa_base_init), (gst_ladspa_init), (gst_ladspa_link), (gst_ladspa_loop), (gst_ladspa_chain), (gst_ladspa_get): * ext/ladspa/gstladspa.h: Memory allocation and timestamping fixes. * ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_negotiate_format): Handle filler events * gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_base_init), (gst_dvd_demux_class_init), (gst_dvd_demux_init), (gst_dvd_demux_send_data), (gst_dvd_demux_handle_dvd_event), (gst_dvd_demux_send_event), (gst_dvd_demux_handle_discont), (gst_dvd_demux_get_video_stream), (gst_dvd_demux_get_audio_stream), (gst_dvd_demux_get_subpicture_stream), (gst_dvd_demux_reset), (gst_dvd_demux_synchronise_pads), (gst_dvd_demux_sync_stream_to_time): * gst/mpegstream/gstdvddemux.h: * gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init), (gst_mpeg_demux_init), (gst_mpeg_demux_send_data), (gst_mpeg_demux_send_discont), (gst_mpeg_demux_send_event), (gst_mpeg_demux_new_output_pad), (gst_mpeg_demux_init_stream), (gst_mpeg_demux_get_audio_stream), (gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes), (gst_mpeg_demux_send_subbuffer), (gst_mpeg_demux_synchronise_pads), (gst_mpeg_demux_sync_stream_to_time), (gst_mpeg_demux_handle_src_event), (gst_mpeg_demux_handle_src_query), (gst_mpeg_demux_reset): * gst/mpegstream/gstmpegdemux.h: * gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_class_init), (gst_mpeg_parse_reset), (gst_mpeg_parse_handle_discont), (gst_mpeg_parse_send_discont), (gst_mpeg_parse_send_event), (gst_mpeg_parse_parse_packhead), (gst_mpeg_parse_handle_src_query), (gst_mpeg_parse_handle_src_event): * gst/mpegstream/gstmpegparse.h: Lots of changes for DVD playback. Still troublesome in playbin, not sure why yet. * gst/wavparse/gstwavparse.c: (gst_wavparse_create_sourcepad), (gst_wavparse_fmt): Some error checks --- ext/dts/gstdtsdec.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'ext/dts') diff --git a/ext/dts/gstdtsdec.c b/ext/dts/gstdtsdec.c index fa7fd5d9..b6e526e5 100644 --- a/ext/dts/gstdtsdec.c +++ b/ext/dts/gstdtsdec.c @@ -333,6 +333,28 @@ gst_dtsdec_handle_event (GstDtsDec * dts, GstEvent * event) dts->cache = NULL; } break; + case GST_EVENT_FILLER:{ + /* Transform filler to always have timestamp + duration */ + GstClockTime end_ts = GST_EVENT_TIMESTAMP (event); + GstClockTime dur = gst_event_filler_get_duration (event); + + if (!GST_CLOCK_TIME_IS_VALID (end_ts)) + end_ts = dts->current_ts; + + if (GST_CLOCK_TIME_IS_VALID (dur)) + end_ts += dur; + + dur = GST_CLOCK_DIFF (end_ts, dts->current_ts); + + gst_event_unref (event); + + if (dur <= 0) + return; + + event = gst_event_new_filler_stamped (dts->current_ts, dur); + dts->current_ts = end_ts; + } + default: break; } -- cgit v1.2.1