mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
Create cue entries for audio only files.
Original commit message from CVS: Create cue entries for audio only files. Fix writing of CUETIME, wrongly used gst_ebml_write_date.
This commit is contained in:
parent
e83fb2a3c2
commit
1fcf92b730
2 changed files with 21 additions and 5 deletions
|
@ -3,7 +3,9 @@
|
|||
* gst/matroska/ebml-ids.h:
|
||||
* gst/matroska/ebml-read.c: (gst_ebml_read_date):
|
||||
* gst/matroska/ebml-write.c: (gst_ebml_write_date):
|
||||
automatically convert unix time <-> ebml time when reading/writing a date
|
||||
* gst/matroska/matroska-mux.c: (gst_matroska_mux_finish):
|
||||
automatically convert unix time <-> ebml time when reading/writing a date,
|
||||
use gst_ebml_write_uint to write CUETIME, not gst_ebml_write_date.
|
||||
* gst/matroska/matroska-ids.h:
|
||||
* gst/matroska/matroska-mux.c: (gst_matroska_mux_create_uid),
|
||||
(gst_matroska_mux_reset), (gst_matroska_mux_audio_pad_link),
|
||||
|
@ -11,6 +13,7 @@
|
|||
(gst_matroska_mux_write_data):
|
||||
Write track and segment UIDs, write muxing date, write
|
||||
TRACKDEFAULTDURATION for TTA audio, write BLOCKDURATION if known.
|
||||
Create cues for audio only files.
|
||||
|
||||
2004-08-31 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||
|
||||
|
|
|
@ -845,7 +845,7 @@ gst_matroska_mux_finish (GstMatroskaMux * mux)
|
|||
|
||||
pointentry_master = gst_ebml_write_master_start (ebml,
|
||||
GST_MATROSKA_ID_POINTENTRY);
|
||||
gst_ebml_write_date (ebml, GST_MATROSKA_ID_CUETIME,
|
||||
gst_ebml_write_uint (ebml, GST_MATROSKA_ID_CUETIME,
|
||||
idx->time / mux->time_scale);
|
||||
trackpos_master = gst_ebml_write_master_start (ebml,
|
||||
GST_MATROSKA_ID_CUETRACKPOSITION);
|
||||
|
@ -969,10 +969,10 @@ gst_matroska_mux_write_data (GstMatroskaMux * mux)
|
|||
mux->sink[i].duration += GST_BUFFER_DURATION (buf);
|
||||
|
||||
/* We currently write an index entry for each keyframe in a
|
||||
* video track. This can be largely improved, such as doing
|
||||
* video track or one entry for each cluster in an audio track
|
||||
* for audio only files. This can be largely improved, such as doing
|
||||
* one for each keyframe or each second (for all-keyframe
|
||||
* streams), only the *first* video track or the audio track
|
||||
* if we have no video tracks. But that'll come later... */
|
||||
* streams), only the *first* video track. But that'll come later... */
|
||||
if (mux->sink[i].track->type == GST_MATROSKA_TRACK_TYPE_VIDEO &&
|
||||
GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_KEY_UNIT)) {
|
||||
GstMatroskaIndex *idx;
|
||||
|
@ -983,6 +983,19 @@ gst_matroska_mux_write_data (GstMatroskaMux * mux)
|
|||
}
|
||||
idx = &mux->index[mux->num_indexes++];
|
||||
|
||||
idx->pos = ebml->pos;
|
||||
idx->time = GST_BUFFER_TIMESTAMP (buf);
|
||||
idx->track = mux->sink[i].track->num;
|
||||
} else if ((mux->sink[i].track->type == GST_MATROSKA_TRACK_TYPE_AUDIO) &&
|
||||
(mux->num_streams == 1)) {
|
||||
GstMatroskaIndex *idx;
|
||||
|
||||
if (mux->num_indexes % 32 == 0) {
|
||||
mux->index = g_renew (GstMatroskaIndex, mux->index,
|
||||
mux->num_indexes + 32);
|
||||
}
|
||||
idx = &mux->index[mux->num_indexes++];
|
||||
|
||||
idx->pos = ebml->pos;
|
||||
idx->time = GST_BUFFER_TIMESTAMP (buf);
|
||||
idx->track = mux->sink[i].track->num;
|
||||
|
|
Loading…
Reference in a new issue