gst_structure_id_get (stream, QUARK_PID, G_TYPE_UINT, &pid,
QUARK_STREAM_TYPE, G_TYPE_UINT, &stream_type, NULL);
+ base->is_pes[pid] = TRUE;
mpegts_base_program_add_stream (base, program,
(guint16) pid, (guint8) stream_type, stream);
- base->is_pes[pid] = TRUE;
}
/* we need to push section packet downstream */
res = mpegts_base_push (base, &packet, §ion);
- } else {
+ } else if (base->is_pes[packet.pid]) {
/* push the packet downstream */
res = mpegts_base_push (base, &packet, NULL);
}
}
static GstPad *
-create_pad_for_stream (GstTSDemux * demux, MpegTSBaseStream * bstream,
+create_pad_for_stream (MpegTSBase * base, MpegTSBaseStream * bstream,
MpegTSBaseProgram * program)
{
TSDemuxStream *stream = (TSDemuxStream *) bstream;
case ST_DSMCC_B:
case ST_DSMCC_C:
case ST_DSMCC_D:
+ base->is_pes[bstream->pid] = FALSE;
break;
case ST_AUDIO_AAC:
template = gst_static_pad_template_get (&audio_template);
gst_ts_demux_stream_added (MpegTSBase * base, MpegTSBaseStream * bstream,
MpegTSBaseProgram * program)
{
- GstTSDemux *tsdemux = (GstTSDemux *) base;
TSDemuxStream *stream = (TSDemuxStream *) bstream;
if (!stream->pad) {
/* Create the pad */
if (bstream->stream_type != 0xff)
- stream->pad = create_pad_for_stream (tsdemux, bstream, program);
+ stream->pad = create_pad_for_stream (base, bstream, program);
stream->pts = GST_CLOCK_TIME_NONE;
}
stream->flow_return = GST_FLOW_OK;
data += 4;
length -= 4;
if (G_UNLIKELY ((psc_stid & 0xffffff00) != 0x00000100)) {
- GST_WARNING ("WRONG PACKET START CODE !");
+ GST_WARNING ("WRONG PACKET START CODE! pid: 0x%x stream_type: 0x%x",
+ stream->stream.pid, stream->stream.stream_type);
goto discont;
}
stid = psc_stid & 0x000000ff;
if (section) {
GST_DEBUG ("section complete:%d, buffer size %d",
section->complete, GST_BUFFER_SIZE (section->buffer));
+ gst_buffer_unref (packet->buffer);
+ return res;
}
if (G_UNLIKELY (packet->payload_unit_start_indicator))