mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
flacparse: Post AUDIO_CODEC tag
https://bugzilla.gnome.org/show_bug.cgi?id=720512
This commit is contained in:
parent
29f2cae129
commit
05e196cbb6
2 changed files with 25 additions and 3 deletions
|
@ -58,9 +58,8 @@
|
|||
#include <string.h>
|
||||
#include <gst/tag/tag.h>
|
||||
#include <gst/audio/audio.h>
|
||||
|
||||
#include <gst/base/gstbitreader.h>
|
||||
#include <gst/base/gstbytereader.h>
|
||||
#include <gst/base/base.h>
|
||||
#include <gst/pbutils/pbutils.h>
|
||||
|
||||
GST_DEBUG_CATEGORY_STATIC (flacparse_debug);
|
||||
#define GST_CAT_DEFAULT flacparse_debug
|
||||
|
@ -338,6 +337,8 @@ gst_flac_parse_start (GstBaseParse * parse)
|
|||
flacparse->sample_number = 0;
|
||||
flacparse->strategy_checked = FALSE;
|
||||
|
||||
flacparse->sent_codec_tag = FALSE;
|
||||
|
||||
/* "fLaC" marker */
|
||||
gst_base_parse_set_min_frame_size (GST_BASE_PARSE (flacparse), 4);
|
||||
|
||||
|
@ -1690,6 +1691,25 @@ gst_flac_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
|
|||
{
|
||||
GstFlacParse *flacparse = GST_FLAC_PARSE (parse);
|
||||
|
||||
if (!flacparse->sent_codec_tag) {
|
||||
GstTagList *taglist;
|
||||
GstCaps *caps;
|
||||
|
||||
taglist = gst_tag_list_new_empty ();
|
||||
|
||||
/* codec tag */
|
||||
caps = gst_pad_get_current_caps (GST_BASE_PARSE_SRC_PAD (parse));
|
||||
gst_pb_utils_add_codec_description_to_tag_list (taglist,
|
||||
GST_TAG_AUDIO_CODEC, caps);
|
||||
gst_caps_unref (caps);
|
||||
|
||||
gst_pad_push_event (GST_BASE_PARSE_SRC_PAD (flacparse),
|
||||
gst_event_new_tag (taglist));
|
||||
|
||||
/* also signals the end of first-frame processing */
|
||||
flacparse->sent_codec_tag = TRUE;
|
||||
}
|
||||
|
||||
/* Push tags */
|
||||
if (flacparse->tags) {
|
||||
gst_pad_push_event (GST_BASE_PARSE_SRC_PAD (flacparse),
|
||||
|
|
|
@ -76,6 +76,8 @@ struct _GstFlacParse {
|
|||
guint64 sample_number;
|
||||
gboolean strategy_checked;
|
||||
|
||||
gboolean sent_codec_tag;
|
||||
|
||||
GstTagList *tags;
|
||||
GstToc *toc;
|
||||
|
||||
|
|
Loading…
Reference in a new issue