Merge branch 'master' into 0.11

Conflicts:
	common
This commit is contained in:
Wim Taymans 2011-09-06 16:37:03 +02:00
commit 83ea243000
4 changed files with 17 additions and 7 deletions

2
common

@ -1 +1 @@
Subproject commit 50b34abb468b6572a92f6700552f6f541c655be8
Subproject commit 605cd9a65ed61505f24b840d3fe8e252be72b151

View file

@ -2204,6 +2204,10 @@ gst_matroska_mux_start (GstMatroskaMux * mux)
child = gst_ebml_write_master_start (ebml, GST_MATROSKA_ID_TRACKENTRY);
gst_matroska_mux_track_header (mux, collect_pad->track);
gst_ebml_write_master_finish (ebml, child);
/* some remaing pad/track setup */
collect_pad->default_duration_scaled =
gst_util_uint64_scale (collect_pad->track->default_duration,
1, mux->time_scale);
}
}
gst_ebml_write_master_finish (ebml, master);
@ -2767,9 +2771,14 @@ gst_matroska_mux_write_data (GstMatroskaMux * mux, GstMatroskaPad * collect_pad)
/* Check if the duration differs from the default duration. */
write_duration = FALSE;
block_duration = GST_BUFFER_DURATION (buf);
block_duration = 0;
if (GST_BUFFER_DURATION_IS_VALID (buf)) {
if (block_duration != collect_pad->track->default_duration) {
block_duration = gst_util_uint64_scale (GST_BUFFER_DURATION (buf),
1, mux->time_scale);
/* small difference should be ok. */
if (block_duration > collect_pad->default_duration_scaled + 1 ||
block_duration < collect_pad->default_duration_scaled - 1) {
write_duration = TRUE;
}
}
@ -2810,10 +2819,8 @@ gst_matroska_mux_write_data (GstMatroskaMux * mux, GstMatroskaPad * collect_pad)
hdr =
gst_matroska_mux_create_buffer_header (collect_pad->track,
relative_timestamp, 0);
if (write_duration) {
gst_ebml_write_uint (ebml, GST_MATROSKA_ID_BLOCKDURATION,
gst_util_uint64_scale (block_duration, 1, mux->time_scale));
}
if (write_duration)
gst_ebml_write_uint (ebml, GST_MATROSKA_ID_BLOCKDURATION, block_duration);
gst_ebml_write_buffer_header (ebml, GST_MATROSKA_ID_BLOCK,
GST_BUFFER_SIZE (buf) + GST_BUFFER_SIZE (hdr));
gst_ebml_write_buffer (ebml, hdr);

View file

@ -64,6 +64,7 @@ typedef struct
guint64 duration;
GstClockTime start_ts;
GstClockTime end_ts; /* last timestamp + (if available) duration */
guint64 default_duration_scaled;
}
GstMatroskaPad;

View file

@ -609,6 +609,8 @@ gst_rtp_mp4g_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
rtpmp4gdepay->next_AU_index = GST_BUFFER_OFFSET (outbuf);
gst_rtp_mp4g_depay_flush_queue (rtpmp4gdepay);
}
/* rebase next_AU_index to current rtp's first AU_index */
rtpmp4gdepay->next_AU_index = AU_index;
}
rtpmp4gdepay->prev_rtptime = rtptime;
rtpmp4gdepay->prev_AU_num = num_AU_headers;