gst/mpegstream/gstmpegparse.c: MPEG2 has a useful rate property, so we can actually use that.

Original commit message from CVS:
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_parse_packhead):
MPEG2 has a useful rate property, so we can actually use that.
For MPEG-1, continue using the bytes/time properties.
This commit is contained in:
Ronald S. Bultje 2005-01-19 15:06:01 +00:00
parent f7b7698b2f
commit baa893dc16
2 changed files with 17 additions and 5 deletions

View file

@ -1,3 +1,9 @@
2005-01-19 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_parse_packhead):
MPEG2 has a useful rate property, so we can actually use that.
For MPEG-1, continue using the bytes/time properties.
2005-01-19 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst-libs/gst/riff/riff-media.c:

View file

@ -470,13 +470,19 @@ gst_mpeg_parse_parse_packhead (GstMPEGParse * mpeg_parse, GstBuffer * buffer)
}
if (mpeg_parse->mux_rate != new_rate) {
mpeg_parse->mux_rate =
(double) mpeg_parse->bytes_since_scr /
MPEGTIME_TO_GSTTIME (mpeg_parse->current_scr -
prev_scr) / 50 * 1000000000;
if (GST_MPEG_PACKETIZE_IS_MPEG2 (mpeg_parse->packetize)) {
mpeg_parse->mux_rate = new_rate;
} else {
mpeg_parse->mux_rate =
(double) mpeg_parse->bytes_since_scr /
MPEGTIME_TO_GSTTIME (mpeg_parse->current_scr -
prev_scr) / 50 * 1000000000;
}
//gst_mpeg_parse_update_streaminfo (mpeg_parse);
GST_DEBUG ("stream is %1.3fMbs", (mpeg_parse->mux_rate * 400) / 1000000.0);
GST_DEBUG ("stream is %1.3fMbs, calculated over %1.3fkB",
(mpeg_parse->mux_rate * 400) / 1000000.0,
mpeg_parse->bytes_since_scr / 1000.0);
}
mpeg_parse->bytes_since_scr = 0;