Set flags on the realmedia chunks

Set the keyframe flags from the RDT packet to the realmedia chunk so that the
descrambler can be reset on keyframes. Fixes #556714.
This commit is contained in:
Wim Taymans 2009-01-26 20:12:41 +01:00
parent 9ce447007e
commit 2dbb5a3923

View file

@ -326,6 +326,8 @@ gst_rdt_depay_handle_data (GstRDTDepay * rdtdepay, GstClockTime outtime,
guint32 timestamp; guint32 timestamp;
gint gap; gint gap;
guint16 seqnum; guint16 seqnum;
guint8 flags;
guint16 outflags;
/* get pointers to the packet data */ /* get pointers to the packet data */
gst_rdt_packet_data_peek_data (packet, &data, &size); gst_rdt_packet_data_peek_data (packet, &data, &size);
@ -339,11 +341,12 @@ gst_rdt_depay_handle_data (GstRDTDepay * rdtdepay, GstClockTime outtime,
/* copy over some things */ /* copy over some things */
stream_id = gst_rdt_packet_data_get_stream_id (packet); stream_id = gst_rdt_packet_data_get_stream_id (packet);
timestamp = gst_rdt_packet_data_get_timestamp (packet); timestamp = gst_rdt_packet_data_get_timestamp (packet);
flags = gst_rdt_packet_data_get_flags (packet);
seqnum = gst_rdt_packet_data_get_seq (packet); seqnum = gst_rdt_packet_data_get_seq (packet);
GST_DEBUG_OBJECT (rdtdepay, "stream_id %u, timestamp %u, seqnum %d", GST_DEBUG_OBJECT (rdtdepay, "stream_id %u, timestamp %u, seqnum %d, flags %d",
stream_id, timestamp, seqnum); stream_id, timestamp, seqnum, flags);
if (rdtdepay->next_seqnum != -1) { if (rdtdepay->next_seqnum != -1) {
gap = gst_rdt_buffer_compare_seqnum (seqnum, rdtdepay->next_seqnum); gap = gst_rdt_buffer_compare_seqnum (seqnum, rdtdepay->next_seqnum);
@ -375,11 +378,16 @@ gst_rdt_depay_handle_data (GstRDTDepay * rdtdepay, GstClockTime outtime,
if (rdtdepay->next_seqnum == 0xff00) if (rdtdepay->next_seqnum == 0xff00)
rdtdepay->next_seqnum = 0; rdtdepay->next_seqnum = 0;
if ((flags & 1) == 0)
outflags = 2;
else
outflags = 0;
GST_WRITE_UINT16_BE (outdata + 0, 0); /* version */ GST_WRITE_UINT16_BE (outdata + 0, 0); /* version */
GST_WRITE_UINT16_BE (outdata + 2, size + 12); /* length */ GST_WRITE_UINT16_BE (outdata + 2, size + 12); /* length */
GST_WRITE_UINT16_BE (outdata + 4, stream_id); /* stream */ GST_WRITE_UINT16_BE (outdata + 4, stream_id); /* stream */
GST_WRITE_UINT32_BE (outdata + 6, timestamp); /* timestamp */ GST_WRITE_UINT32_BE (outdata + 6, timestamp); /* timestamp */
GST_WRITE_UINT16_BE (outdata + 10, 0); /* flags */ GST_WRITE_UINT16_BE (outdata + 10, outflags); /* flags */
memcpy (outdata + 12, data, size); memcpy (outdata + 12, data, size);
GST_DEBUG_OBJECT (rdtdepay, "Pushing packet, outtime %" GST_TIME_FORMAT, GST_DEBUG_OBJECT (rdtdepay, "Pushing packet, outtime %" GST_TIME_FORMAT,