diff options
author | Dave Robillard <dave@drobilla.net> | 2009-05-26 19:11:45 -0400 |
---|---|---|
committer | Dave Robillard <dave@drobilla.net> | 2009-05-26 19:11:45 -0400 |
commit | 0b46abe9aec9d8903430f49fe17f92dd8b0ba00e (patch) | |
tree | 5b4d6d8b85c0b002d4d503e75d6edc6772fcce85 /ext/resindvd | |
parent | e9f9ffa0e5ca0844a499a106963888176b6a7372 (diff) | |
parent | b75a26657febaf86c4137b4d41c068926325e316 (diff) | |
download | gst-plugins-bad-0b46abe9aec9d8903430f49fe17f92dd8b0ba00e.tar.gz gst-plugins-bad-0b46abe9aec9d8903430f49fe17f92dd8b0ba00e.tar.bz2 gst-plugins-bad-0b46abe9aec9d8903430f49fe17f92dd8b0ba00e.zip |
Merge branch 'fdo' into lv2
Diffstat (limited to 'ext/resindvd')
-rw-r--r-- | ext/resindvd/gstmpegdemux.c | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/ext/resindvd/gstmpegdemux.c b/ext/resindvd/gstmpegdemux.c index b360bdcc..5ab26107 100644 --- a/ext/resindvd/gstmpegdemux.c +++ b/ext/resindvd/gstmpegdemux.c @@ -495,8 +495,10 @@ gst_flups_demux_send_segment_updates (GstFluPSDemux * demux, if (stream->last_ts + stream->segment_thresh < new_time) { #if 0 g_print ("Segment update to pad %s time %" GST_TIME_FORMAT " stop now %" - GST_TIME_FORMAT "\n", GST_PAD_NAME (stream->pad), - GST_TIME_ARGS (new_time), GST_TIME_ARGS (demux->src_segment.stop)); + GST_TIME_FORMAT " last_stop %" GST_TIME_FORMAT "\n", + GST_PAD_NAME (stream->pad), GST_TIME_ARGS (new_time), + GST_TIME_ARGS (demux->src_segment.stop), + GST_TIME_ARGS (demux->src_segment.last_stop)); #endif GST_DEBUG_OBJECT (demux, "Segment update to pad %s time %" GST_TIME_FORMAT, @@ -524,6 +526,10 @@ gst_flups_demux_send_segment_close (GstFluPSDemux * demux) { gint id; GstEvent *event = NULL; + GstClockTime stop = demux->src_segment.stop; + + if (demux->src_segment.last_stop != -1 && demux->src_segment.last_stop > stop) + stop = demux->src_segment.last_stop; for (id = 0; id < GST_FLUPS_DEMUX_MAX_STREAMS; id++) { GstFluPSStream *stream = demux->streams[id]; @@ -534,23 +540,23 @@ gst_flups_demux_send_segment_close (GstFluPSDemux * demux) if (stream->last_seg_start != GST_CLOCK_TIME_NONE && stream->last_seg_start > start) start = stream->last_seg_start; + #if 0 g_print ("Segment close to pad %s start %" GST_TIME_FORMAT " stop %" GST_TIME_FORMAT "\n", GST_PAD_NAME (stream->pad), GST_TIME_ARGS (start), - GST_TIME_ARGS (demux->src_segment.stop)); + GST_TIME_ARGS (stop)); #endif - if (start > demux->src_segment.stop) { + if (start > stop) { g_print ("Problem on pad %s with start %" GST_TIME_FORMAT " > stop %" GST_TIME_FORMAT "\n", gst_object_get_name (GST_OBJECT (stream->pad)), - GST_TIME_ARGS (start), GST_TIME_ARGS (demux->src_segment.stop)); + GST_TIME_ARGS (start), GST_TIME_ARGS (stop)); } event = gst_event_new_new_segment_full (TRUE, demux->src_segment.rate, demux->src_segment.applied_rate, GST_FORMAT_TIME, start, - demux->src_segment.stop, - demux->src_segment.time + (start - demux->src_segment.start)); + stop, demux->src_segment.time + (start - demux->src_segment.start)); if (event) gst_pad_push_event (stream->pad, event); } @@ -566,7 +572,7 @@ gst_flups_demux_send_event (GstFluPSDemux * demux, GstEvent * event) for (id = 0; id < GST_FLUPS_DEMUX_MAX_STREAMS; id++) { GstFluPSStream *stream = demux->streams[id]; - if (stream && !stream->notlinked) { + if (stream) { (void) gst_event_ref (event); if (!gst_pad_push_event (stream->pad, event)) { @@ -733,6 +739,8 @@ gst_flups_demux_handle_dvd_event (GstFluPSDemux * demux, GstEvent * event) "event", G_TYPE_STRING, "select-pad", NULL); GstEvent *sel_event = gst_event_new_custom (GST_EVENT_CUSTOM_DOWNSTREAM, s); + + temp->notlinked = FALSE; gst_pad_push_event (temp->pad, sel_event); gst_event_ref (event); @@ -872,8 +880,12 @@ gst_flups_demux_sink_event (GstPad * pad, GstEvent * event) else demux->scr_adjust = -GSTTIME_TO_MPEGTIME (-adjust); - if (stop != -1) + if (stop != -1) { stop = start + dur; + if (demux->src_segment.last_stop != -1 + && demux->src_segment.last_stop > stop) + stop = demux->src_segment.last_stop; + } GST_DEBUG_OBJECT (demux, "sending new segment: update %d rate %g format %d, start: %" @@ -1150,7 +1162,7 @@ gst_flups_demux_reset_psm (GstFluPSDemux * demux) FILL_TYPE (0x40, 0x7f, -1); FILL_TYPE (0x80, 0x87, ST_PS_AUDIO_AC3); FILL_TYPE (0x88, 0x9f, ST_PS_AUDIO_DTS); - FILL_TYPE (0xa0, 0xbf, ST_PS_AUDIO_LPCM); + FILL_TYPE (0xa0, 0xaf, ST_PS_AUDIO_LPCM); FILL_TYPE (0xbd, 0xbd, -1); FILL_TYPE (0xc0, 0xdf, ST_AUDIO_MPEG1); FILL_TYPE (0xe0, 0xef, ST_GST_VIDEO_MPEG1_OR_2); @@ -1362,12 +1374,8 @@ gst_flups_demux_parse_pack_start (GstFluPSDemux * demux) new_time = MPEGTIME_TO_GSTTIME (scr_adjusted); if (new_time != GST_CLOCK_TIME_NONE) { // g_print ("SCR now %" GST_TIME_FORMAT "\n", GST_TIME_ARGS (new_time)); - if (new_time > GST_SECOND / 2) - new_time -= GST_SECOND / 2; - else - new_time = 0; + gst_segment_set_last_stop (&demux->src_segment, GST_FORMAT_TIME, new_time); gst_flups_demux_send_segment_updates (demux, new_time); - demux->src_segment.last_stop = new_time; } /* Reset the bytes_since_scr value to count the data remaining in the @@ -1861,7 +1869,7 @@ need_data: } } -static gboolean +static inline gboolean gst_flups_demux_is_pes_sync (guint32 sync) { return ((sync & 0xfc) == 0xbc) || |