mpegaudioparse: Remove empty lines added by buggy indent.

This commit is contained in:
René Stadler 2009-03-04 16:15:00 +02:00
parent d950699d2e
commit be6292d4de

View file

@ -102,26 +102,19 @@ enum
static void gst_mp3parse_class_init (GstMPEGAudioParseClass * klass); static void gst_mp3parse_class_init (GstMPEGAudioParseClass * klass);
static void gst_mp3parse_base_init (gpointer klass); static void gst_mp3parse_base_init (gpointer klass);
static void gst_mp3parse_init (GstMPEGAudioParse * mp3parse, static void gst_mp3parse_init (GstMPEGAudioParse * mp3parse,
GstMPEGAudioParseClass * klass); GstMPEGAudioParseClass * klass);
static gboolean gst_mp3parse_sink_event (GstPad * pad, GstEvent * event); static gboolean gst_mp3parse_sink_event (GstPad * pad, GstEvent * event);
static GstFlowReturn gst_mp3parse_chain (GstPad * pad, GstBuffer * buffer); static GstFlowReturn gst_mp3parse_chain (GstPad * pad, GstBuffer * buffer);
static gboolean mp3parse_src_query (GstPad * pad, GstQuery * query); static gboolean mp3parse_src_query (GstPad * pad, GstQuery * query);
static const GstQueryType *mp3parse_get_query_types (GstPad * pad); static const GstQueryType *mp3parse_get_query_types (GstPad * pad);
static gboolean mp3parse_src_event (GstPad * pad, GstEvent * event); static gboolean mp3parse_src_event (GstPad * pad, GstEvent * event);
static int head_check (GstMPEGAudioParse * mp3parse, unsigned long head); static int head_check (GstMPEGAudioParse * mp3parse, unsigned long head);
static void gst_mp3parse_dispose (GObject * object); static void gst_mp3parse_dispose (GObject * object);
static void gst_mp3parse_set_property (GObject * object, guint prop_id, static void gst_mp3parse_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec); const GValue * value, GParamSpec * pspec);
static void gst_mp3parse_get_property (GObject * object, guint prop_id, static void gst_mp3parse_get_property (GObject * object, guint prop_id,
@ -143,7 +136,6 @@ static GType
gst_mp3_channel_mode_get_type (void) gst_mp3_channel_mode_get_type (void)
{ {
static GType mp3_channel_mode_type = 0; static GType mp3_channel_mode_type = 0;
static GEnumValue mp3_channel_mode[] = { static GEnumValue mp3_channel_mode[] = {
{MP3_CHANNEL_MODE_UNKNOWN, "Unknown", "unknown"}, {MP3_CHANNEL_MODE_UNKNOWN, "Unknown", "unknown"},
{MP3_CHANNEL_MODE_MONO, "Mono", "mono"}, {MP3_CHANNEL_MODE_MONO, "Mono", "mono"},
@ -188,7 +180,6 @@ mp3_type_frame_length_from_header (GstMPEGAudioParse * mp3parse, guint32 header,
gulong mode, samplerate, bitrate, layer, channels, padding, crc; gulong mode, samplerate, bitrate, layer, channels, padding, crc;
gulong version; gulong version;
gint lsf, mpg25; gint lsf, mpg25;
GEnumValue *mode_enum; GEnumValue *mode_enum;
if (header & (1 << 20)) { if (header & (1 << 20)) {
@ -297,7 +288,6 @@ static void
gst_mp3parse_class_init (GstMPEGAudioParseClass * klass) gst_mp3parse_class_init (GstMPEGAudioParseClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
GstElementClass *gstelement_class; GstElementClass *gstelement_class;
gobject_class = (GObjectClass *) klass; gobject_class = (GObjectClass *) klass;
@ -448,9 +438,7 @@ static gboolean
gst_mp3parse_sink_event (GstPad * pad, GstEvent * event) gst_mp3parse_sink_event (GstPad * pad, GstEvent * event)
{ {
gboolean res = TRUE; gboolean res = TRUE;
GstMPEGAudioParse *mp3parse; GstMPEGAudioParse *mp3parse;
GstEvent **eventp; GstEvent **eventp;
mp3parse = GST_MP3PARSE (gst_pad_get_parent (pad)); mp3parse = GST_MP3PARSE (gst_pad_get_parent (pad));
@ -459,11 +447,8 @@ gst_mp3parse_sink_event (GstPad * pad, GstEvent * event)
case GST_EVENT_NEWSEGMENT: case GST_EVENT_NEWSEGMENT:
{ {
gdouble rate, applied_rate; gdouble rate, applied_rate;
GstFormat format; GstFormat format;
gint64 start, stop, pos; gint64 start, stop, pos;
gboolean update; gboolean update;
gst_event_parse_new_segment_full (event, &update, &rate, &applied_rate, gst_event_parse_new_segment_full (event, &update, &rate, &applied_rate,
@ -472,7 +457,6 @@ gst_mp3parse_sink_event (GstPad * pad, GstEvent * event)
g_mutex_lock (mp3parse->pending_accurate_seeks_lock); g_mutex_lock (mp3parse->pending_accurate_seeks_lock);
if (format == GST_FORMAT_BYTES && mp3parse->pending_accurate_seeks) { if (format == GST_FORMAT_BYTES && mp3parse->pending_accurate_seeks) {
MPEGAudioPendingAccurateSeek *seek = NULL; MPEGAudioPendingAccurateSeek *seek = NULL;
GSList *node; GSList *node;
for (node = mp3parse->pending_accurate_seeks; node; node = node->next) { for (node = mp3parse->pending_accurate_seeks; node; node = node->next) {
@ -623,13 +607,9 @@ gst_mp3parse_emit_frame (GstMPEGAudioParse * mp3parse, guint size,
guint mode, guint crc) guint mode, guint crc)
{ {
GstBuffer *outbuf; GstBuffer *outbuf;
guint bitrate; guint bitrate;
GstFlowReturn ret = GST_FLOW_OK; GstFlowReturn ret = GST_FLOW_OK;
GstClockTime push_start; GstClockTime push_start;
GstTagList *taglist; GstTagList *taglist;
outbuf = gst_adapter_take_buffer (mp3parse->adapter, size); outbuf = gst_adapter_take_buffer (mp3parse->adapter, size);
@ -859,21 +839,15 @@ static void
gst_mp3parse_handle_first_frame (GstMPEGAudioParse * mp3parse) gst_mp3parse_handle_first_frame (GstMPEGAudioParse * mp3parse)
{ {
GstTagList *taglist; GstTagList *taglist;
gchar *codec; gchar *codec;
const guint32 xing_id = 0x58696e67; /* 'Xing' in hex */ const guint32 xing_id = 0x58696e67; /* 'Xing' in hex */
const guint32 info_id = 0x496e666f; /* 'Info' in hex - found in LAME CBR files */ const guint32 info_id = 0x496e666f; /* 'Info' in hex - found in LAME CBR files */
const guint32 vbri_id = 0x56425249; /* 'VBRI' in hex */ const guint32 vbri_id = 0x56425249; /* 'VBRI' in hex */
gint offset; gint offset;
guint64 avail; guint64 avail;
guint32 read_id; guint32 read_id;
const guint8 *data; const guint8 *data;
/* Output codec tag */ /* Output codec tag */
@ -927,11 +901,8 @@ gst_mp3parse_handle_first_frame (GstMPEGAudioParse * mp3parse)
read_id = GST_READ_UINT32_BE (data); read_id = GST_READ_UINT32_BE (data);
if (read_id == xing_id || read_id == info_id) { if (read_id == xing_id || read_id == info_id) {
guint32 xing_flags; guint32 xing_flags;
guint bytes_needed = offset + 8; guint bytes_needed = offset + 8;
gint64 total_bytes; gint64 total_bytes;
GstClockTime total_time; GstClockTime total_time;
GST_DEBUG_OBJECT (mp3parse, "Found Xing header marker 0x%x", xing_id); GST_DEBUG_OBJECT (mp3parse, "Found Xing header marker 0x%x", xing_id);
@ -999,9 +970,7 @@ gst_mp3parse_handle_first_frame (GstMPEGAudioParse * mp3parse)
if (xing_flags & XING_TOC_FLAG) { if (xing_flags & XING_TOC_FLAG) {
int i, percent = 0; int i, percent = 0;
guchar *table = mp3parse->xing_seek_table; guchar *table = mp3parse->xing_seek_table;
guchar old = 0; guchar old = 0;
if (data[0] != 0) { if (data[0] != 0) {
@ -1029,7 +998,6 @@ gst_mp3parse_handle_first_frame (GstMPEGAudioParse * mp3parse)
mp3parse->xing_seek_table_inverse[i] = percent * 100; mp3parse->xing_seek_table_inverse[i] = percent * 100;
} else if (table[percent] < i && percent < 99) { } else if (table[percent] < i && percent < 99) {
gdouble fa, fb, fx; gdouble fa, fb, fx;
gint a = percent, b = percent + 1; gint a = percent, b = percent + 1;
fa = table[a]; fa = table[a];
@ -1038,7 +1006,6 @@ gst_mp3parse_handle_first_frame (GstMPEGAudioParse * mp3parse)
mp3parse->xing_seek_table_inverse[i] = (guint16) (fx * 100); mp3parse->xing_seek_table_inverse[i] = (guint16) (fx * 100);
} else if (percent == 98 && table[percent + 1] <= i) { } else if (percent == 98 && table[percent + 1] <= i) {
gdouble fa, fb, fx; gdouble fa, fb, fx;
gint a = percent + 1, b = 100; gint a = percent + 1, b = 100;
fa = table[a]; fa = table[a];
@ -1066,9 +1033,7 @@ gst_mp3parse_handle_first_frame (GstMPEGAudioParse * mp3parse)
mp3parse->xing_vbr_scale); mp3parse->xing_vbr_scale);
} else if (read_id == vbri_id) { } else if (read_id == vbri_id) {
gint64 total_bytes, total_frames; gint64 total_bytes, total_frames;
GstClockTime total_time; GstClockTime total_time;
guint16 nseek_points; guint16 nseek_points;
GST_DEBUG_OBJECT (mp3parse, "Found VBRI header marker 0x%x", vbri_id); GST_DEBUG_OBJECT (mp3parse, "Found VBRI header marker 0x%x", vbri_id);
@ -1123,7 +1088,6 @@ gst_mp3parse_handle_first_frame (GstMPEGAudioParse * mp3parse)
if (nseek_points > 0) { if (nseek_points > 0) {
guint scale, seek_bytes, seek_frames; guint scale, seek_bytes, seek_frames;
gint i; gint i;
mp3parse->vbri_seek_points = nseek_points; mp3parse->vbri_seek_points = nseek_points;
@ -1197,17 +1161,11 @@ static GstFlowReturn
gst_mp3parse_chain (GstPad * pad, GstBuffer * buf) gst_mp3parse_chain (GstPad * pad, GstBuffer * buf)
{ {
GstFlowReturn flow = GST_FLOW_OK; GstFlowReturn flow = GST_FLOW_OK;
GstMPEGAudioParse *mp3parse; GstMPEGAudioParse *mp3parse;
const guchar *data; const guchar *data;
guint32 header; guint32 header;
int bpf; int bpf;
guint available; guint available;
GstClockTime timestamp; GstClockTime timestamp;
mp3parse = GST_MP3PARSE (GST_PAD_PARENT (pad)); mp3parse = GST_MP3PARSE (GST_PAD_PARENT (pad));
@ -1286,7 +1244,6 @@ gst_mp3parse_chain (GstPad * pad, GstBuffer * buf)
*************************************************************************/ *************************************************************************/
if (mp3parse->resyncing) { if (mp3parse->resyncing) {
guint32 header2; guint32 header2;
const guint8 *data2; const guint8 *data2;
/* wait until we have the the entire current frame as well as the next /* wait until we have the the entire current frame as well as the next
@ -1499,7 +1456,6 @@ static GstStateChangeReturn
gst_mp3parse_change_state (GstElement * element, GstStateChange transition) gst_mp3parse_change_state (GstElement * element, GstStateChange transition)
{ {
GstMPEGAudioParse *mp3parse; GstMPEGAudioParse *mp3parse;
GstStateChangeReturn result; GstStateChangeReturn result;
mp3parse = GST_MP3PARSE (element); mp3parse = GST_MP3PARSE (element);
@ -1574,7 +1530,6 @@ mp3parse_time_to_bytepos (GstMPEGAudioParse * mp3parse, GstClockTime ts,
gint64 * bytepos) gint64 * bytepos)
{ {
gint64 total_bytes; gint64 total_bytes;
GstClockTime total_time; GstClockTime total_time;
/* -1 always maps to -1 */ /* -1 always maps to -1 */
@ -1588,7 +1543,6 @@ mp3parse_time_to_bytepos (GstMPEGAudioParse * mp3parse, GstClockTime ts,
mp3parse_total_bytes (mp3parse, &total_bytes) && mp3parse_total_bytes (mp3parse, &total_bytes) &&
mp3parse_total_time (mp3parse, &total_time)) { mp3parse_total_time (mp3parse, &total_time)) {
gdouble fa, fb, fx; gdouble fa, fb, fx;
gdouble percent = gdouble percent =
CLAMP ((100.0 * gst_util_guint64_to_gdouble (ts)) / CLAMP ((100.0 * gst_util_guint64_to_gdouble (ts)) /
gst_util_guint64_to_gdouble (total_time), 0.0, 100.0); gst_util_guint64_to_gdouble (total_time), 0.0, 100.0);
@ -1611,7 +1565,6 @@ mp3parse_time_to_bytepos (GstMPEGAudioParse * mp3parse, GstClockTime ts,
mp3parse_total_bytes (mp3parse, &total_bytes) && mp3parse_total_bytes (mp3parse, &total_bytes) &&
mp3parse_total_time (mp3parse, &total_time)) { mp3parse_total_time (mp3parse, &total_time)) {
gint i, j; gint i, j;
gdouble a, b, fa, fb; gdouble a, b, fa, fb;
i = gst_util_uint64_scale (ts, mp3parse->vbri_seek_points - 1, total_time); i = gst_util_uint64_scale (ts, mp3parse->vbri_seek_points - 1, total_time);
@ -1653,7 +1606,6 @@ mp3parse_bytepos_to_time (GstMPEGAudioParse * mp3parse,
gint64 bytepos, GstClockTime * ts, gboolean from_total_time) gint64 bytepos, GstClockTime * ts, gboolean from_total_time)
{ {
gint64 total_bytes; gint64 total_bytes;
GstClockTime total_time; GstClockTime total_time;
if (bytepos == -1) { if (bytepos == -1) {
@ -1671,9 +1623,7 @@ mp3parse_bytepos_to_time (GstMPEGAudioParse * mp3parse,
mp3parse_total_bytes (mp3parse, &total_bytes) && mp3parse_total_bytes (mp3parse, &total_bytes) &&
mp3parse_total_time (mp3parse, &total_time)) { mp3parse_total_time (mp3parse, &total_time)) {
gdouble fa, fb, fx; gdouble fa, fb, fx;
gdouble pos = CLAMP ((bytepos * 256.0) / total_bytes, 0.0, 256.0); gdouble pos = CLAMP ((bytepos * 256.0) / total_bytes, 0.0, 256.0);
gint index = CLAMP (pos, 0, 255); gint index = CLAMP (pos, 0, 255);
fa = mp3parse->xing_seek_table_inverse[index]; fa = mp3parse->xing_seek_table_inverse[index];
@ -1693,9 +1643,7 @@ mp3parse_bytepos_to_time (GstMPEGAudioParse * mp3parse,
mp3parse_total_bytes (mp3parse, &total_bytes) && mp3parse_total_bytes (mp3parse, &total_bytes) &&
mp3parse_total_time (mp3parse, &total_time)) { mp3parse_total_time (mp3parse, &total_time)) {
gint i = 0; gint i = 0;
guint64 sum = 0; guint64 sum = 0;
gdouble a, b, fa, fb; gdouble a, b, fa, fb;
@ -1737,15 +1685,10 @@ static gboolean
mp3parse_handle_seek (GstMPEGAudioParse * mp3parse, GstEvent * event) mp3parse_handle_seek (GstMPEGAudioParse * mp3parse, GstEvent * event)
{ {
GstFormat format; GstFormat format;
gdouble rate; gdouble rate;
GstSeekFlags flags; GstSeekFlags flags;
GstSeekType cur_type, stop_type; GstSeekType cur_type, stop_type;
gint64 cur, stop; gint64 cur, stop;
gint64 byte_cur, byte_stop; gint64 byte_cur, byte_stop;
gst_event_parse_seek (event, &rate, &format, &flags, &cur_type, &cur, gst_event_parse_seek (event, &rate, &format, &flags, &cur_type, &cur,
@ -1792,7 +1735,6 @@ mp3parse_handle_seek (GstMPEGAudioParse * mp3parse, GstEvent * event)
start = 0; start = 0;
} else { } else {
MPEGAudioSeekEntry *entry = NULL, *start_entry = NULL, *stop_entry = NULL; MPEGAudioSeekEntry *entry = NULL, *start_entry = NULL, *stop_entry = NULL;
GList *start_node, *stop_node; GList *start_node, *stop_node;
gint64 seek_ts = (cur > mp3parse->max_bitreservoir) ? gint64 seek_ts = (cur > mp3parse->max_bitreservoir) ?
(cur - mp3parse->max_bitreservoir) : 0; (cur - mp3parse->max_bitreservoir) : 0;
@ -1880,7 +1822,6 @@ static gboolean
mp3parse_src_event (GstPad * pad, GstEvent * event) mp3parse_src_event (GstPad * pad, GstEvent * event)
{ {
GstMPEGAudioParse *mp3parse = GST_MP3PARSE (gst_pad_get_parent (pad)); GstMPEGAudioParse *mp3parse = GST_MP3PARSE (gst_pad_get_parent (pad));
gboolean res = FALSE; gboolean res = FALSE;
g_return_val_if_fail (mp3parse != NULL, FALSE); g_return_val_if_fail (mp3parse != NULL, FALSE);
@ -1903,13 +1844,9 @@ static gboolean
mp3parse_src_query (GstPad * pad, GstQuery * query) mp3parse_src_query (GstPad * pad, GstQuery * query)
{ {
GstFormat format; GstFormat format;
GstClockTime total; GstClockTime total;
GstMPEGAudioParse *mp3parse = GST_MP3PARSE (gst_pad_get_parent (pad)); GstMPEGAudioParse *mp3parse = GST_MP3PARSE (gst_pad_get_parent (pad));
gboolean res = FALSE; gboolean res = FALSE;
GstPad *peer; GstPad *peer;
g_return_val_if_fail (mp3parse != NULL, FALSE); g_return_val_if_fail (mp3parse != NULL, FALSE);