diff options
author | Arwed v. Merkatz <v.merkatz@gmx.net> | 2004-09-01 13:41:37 +0000 |
---|---|---|
committer | Arwed v. Merkatz <v.merkatz@gmx.net> | 2004-09-01 13:41:37 +0000 |
commit | 1fcf92b730c84d133d30119c6cd10841fd769296 (patch) | |
tree | 53fee6ab106c6fb68513431fc3aec1e11ab7d19b /gst | |
parent | e83fb2a3c26a1a704a59e3eb03465782535e62e0 (diff) |
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.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/matroska/matroska-mux.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/gst/matroska/matroska-mux.c b/gst/matroska/matroska-mux.c index a37e008e..93d9dfe0 100644 --- a/gst/matroska/matroska-mux.c +++ b/gst/matroska/matroska-mux.c @@ -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; @@ -986,6 +986,19 @@ gst_matroska_mux_write_data (GstMatroskaMux * mux) 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; } /* write one cluster with one blockgroup with one block with |