ext/mad/gstmad.c: Fail if caps negotiation fails. Should fix #162184, and should definately be in there regardless of...

Original commit message from CVS:
* ext/mad/gstmad.c: (gst_mad_check_caps_reset), (gst_mad_chain):
Fail if caps negotiation fails. Should fix #162184, and should
definately be in there regardless of it fixing the actual bug.
* gst/avi/gstavimux.c: (gst_avimux_get_type), (gst_avimux_init),
(gst_avimux_write_tag), (gst_avimux_riff_get_avi_header),
(gst_avimux_riff_get_avix_header),
(gst_avimux_riff_get_video_header),
(gst_avimux_riff_get_audio_header), (gst_avimux_write_index),
(gst_avimux_start_file), (gst_avimux_handle_event),
(gst_avimux_change_state):
* gst/avi/gstavimux.h:
Refactor structure writing to use GST_WRITE_UINT macros, add
metadata writing support.
This commit is contained in:
Ronald S. Bultje 2005-01-19 11:01:09 +00:00
parent 479836c150
commit 911cb0f678
2 changed files with 30 additions and 5 deletions

View file

@ -1,3 +1,19 @@
2005-01-19 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/mad/gstmad.c: (gst_mad_check_caps_reset), (gst_mad_chain):
Fail if caps negotiation fails. Should fix #162184, and should
definately be in there regardless of it fixing the actual bug.
* gst/avi/gstavimux.c: (gst_avimux_get_type), (gst_avimux_init),
(gst_avimux_write_tag), (gst_avimux_riff_get_avi_header),
(gst_avimux_riff_get_avix_header),
(gst_avimux_riff_get_video_header),
(gst_avimux_riff_get_audio_header), (gst_avimux_write_index),
(gst_avimux_start_file), (gst_avimux_handle_event),
(gst_avimux_change_state):
* gst/avi/gstavimux.h:
Refactor structure writing to use GST_WRITE_UINT macros, add
metadata writing support.
2005-01-18 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/playback/gststreaminfo.c: (gst_stream_info_dispose):

View file

@ -1126,7 +1126,7 @@ mpg123_parse_xing_header (struct mad_header *header,
/* internal function to check if the header has changed and thus the
* caps need to be reset. Only call during normal mode, not resyncing */
static void
static gboolean
gst_mad_check_caps_reset (GstMad * mad)
{
guint nchannels;
@ -1157,8 +1157,10 @@ gst_mad_check_caps_reset (GstMad * mad)
mad->pending_channels = nchannels;
mad->pending_rate = rate;
}
/* Now, we already have a valid caps set and will continue to use
* that for a while longer, so we cans afely return TRUE here. */
if (++mad->times_pending < 3)
return;
return TRUE;
}
}
gst_mad_update_info (mad);
@ -1182,9 +1184,15 @@ gst_mad_check_caps_reset (GstMad * mad)
mad->caps_set = TRUE; /* set back to FALSE on discont */
mad->channels = nchannels;
mad->rate = rate;
} else {
GST_ELEMENT_ERROR (mad, CORE, NEGOTIATION, (NULL),
("Failed to negotiate %d Hz, %d channels", rate, nchannels));
return FALSE;
}
gst_caps_free (caps);
}
return TRUE;
}
static void
@ -1370,7 +1378,6 @@ gst_mad_chain (GstPad * pad, GstData * _data)
GST_DEBUG ("synced to data: 0x%0x 0x%0x", *mad->stream.ptr.byte,
*(mad->stream.ptr.byte + 1));
mad_stream_sync (&mad->stream);
/* recoverable errors pass */
}
@ -1403,8 +1410,10 @@ gst_mad_chain (GstPad * pad, GstData * _data)
}
/* if we're not resyncing/in error, check if caps need to be set again */
if (!mad->in_error)
gst_mad_check_caps_reset (mad);
if (!mad->in_error) {
if (!gst_mad_check_caps_reset (mad))
goto end;
}
nsamples = MAD_NSBSAMPLES (&mad->frame.header) *
(mad->stream.options & MAD_OPTION_HALFSAMPLERATE ? 16 : 32);