mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 20:59:44 +00:00
ext/vorbis/vorbisenc.*: Set duration on encoded buffers. This allows oggmux's max_page_delay parameter to actually work.
Original commit message from CVS: * ext/vorbis/vorbisenc.c: (gst_vorbisenc_setup), (gst_vorbisenc_buffer_from_packet): * ext/vorbis/vorbisenc.h: Set duration on encoded buffers. This allows oggmux's max_page_delay parameter to actually work.
This commit is contained in:
parent
f407a3766e
commit
4427a67754
3 changed files with 14 additions and 0 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2005-11-11 Michael Smith <msmith@fluendo.com>
|
||||||
|
|
||||||
|
* ext/vorbis/vorbisenc.c: (gst_vorbisenc_setup),
|
||||||
|
(gst_vorbisenc_buffer_from_packet):
|
||||||
|
* ext/vorbis/vorbisenc.h:
|
||||||
|
Set duration on encoded buffers. This allows oggmux's
|
||||||
|
max_page_delay parameter to actually work.
|
||||||
|
|
||||||
2005-11-11 Tim-Philipp Müller <tim at centricular dot net>
|
2005-11-11 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
|
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
|
||||||
|
|
|
@ -772,6 +772,8 @@ gst_vorbisenc_setup (GstVorbisEnc * vorbisenc)
|
||||||
vorbis_analysis_init (&vorbisenc->vd, &vorbisenc->vi);
|
vorbis_analysis_init (&vorbisenc->vd, &vorbisenc->vi);
|
||||||
vorbis_block_init (&vorbisenc->vd, &vorbisenc->vb);
|
vorbis_block_init (&vorbisenc->vd, &vorbisenc->vb);
|
||||||
|
|
||||||
|
vorbisenc->prev_ts = 0;
|
||||||
|
|
||||||
vorbisenc->setup = TRUE;
|
vorbisenc->setup = TRUE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -808,6 +810,9 @@ gst_vorbisenc_buffer_from_packet (GstVorbisEnc * vorbisenc, ogg_packet * packet)
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) =
|
GST_BUFFER_TIMESTAMP (outbuf) =
|
||||||
vorbis_granule_time_copy (&vorbisenc->vd,
|
vorbis_granule_time_copy (&vorbisenc->vd,
|
||||||
packet->granulepos) * GST_SECOND;
|
packet->granulepos) * GST_SECOND;
|
||||||
|
GST_BUFFER_DURATION (outbuf) =
|
||||||
|
GST_BUFFER_TIMESTAMP (outbuf) - vorbisenc->prev_ts;
|
||||||
|
vorbisenc->prev_ts = GST_BUFFER_TIMESTAMP (outbuf);
|
||||||
|
|
||||||
GST_DEBUG ("encoded buffer of %d bytes", GST_BUFFER_SIZE (outbuf));
|
GST_DEBUG ("encoded buffer of %d bytes", GST_BUFFER_SIZE (outbuf));
|
||||||
return outbuf;
|
return outbuf;
|
||||||
|
|
|
@ -69,6 +69,7 @@ struct _GstVorbisEnc {
|
||||||
|
|
||||||
guint64 samples_in;
|
guint64 samples_in;
|
||||||
guint64 bytes_out;
|
guint64 bytes_out;
|
||||||
|
GstClockTime prev_ts;
|
||||||
|
|
||||||
GstTagList * tags;
|
GstTagList * tags;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue