mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-22 05:56:31 +00:00
Don't reset flac decoder if init hasn't been called on it first, the flac decoder crashed on me because of that
Original commit message from CVS: Don't reset flac decoder if init hasn't been called on it first, the flac decoder crashed on me because of that
This commit is contained in:
parent
521647fca9
commit
fb6d78f666
1 changed files with 14 additions and 8 deletions
|
@ -567,9 +567,14 @@ gst_flacdec_loop (GstElement *element)
|
|||
|
||||
GST_DEBUG ("flacdec: entering loop");
|
||||
if (flacdec->init) {
|
||||
FLAC__StreamDecoderState res;
|
||||
GST_DEBUG ("flacdec: initializing decoder");
|
||||
FLAC__seekable_stream_decoder_init (flacdec->decoder);
|
||||
/* FLAC__seekable_stream_decoder_process_metadata (flacdec->decoder); */
|
||||
res = FLAC__seekable_stream_decoder_init (flacdec->decoder);
|
||||
if (res != FLAC__SEEKABLE_STREAM_DECODER_OK) {
|
||||
gst_element_error (GST_ELEMENT (flacdec), FLAC__SeekableStreamDecoderStateString[res]);
|
||||
return;
|
||||
}
|
||||
/* FLAC__seekable_stream_decoder_process_metadata (flacdec->decoder);*/
|
||||
flacdec->init = FALSE;
|
||||
}
|
||||
|
||||
|
@ -763,9 +768,10 @@ gst_flacdec_change_state (GstElement *element)
|
|||
flacdec->bs = gst_bytestream_new (flacdec->sinkpad);
|
||||
flacdec->seek_pending = FALSE;
|
||||
flacdec->total_samples = 0;
|
||||
flacdec->init = TRUE;
|
||||
flacdec->eos = FALSE;
|
||||
if (flacdec->init == FALSE) {
|
||||
FLAC__seekable_stream_decoder_reset (flacdec->decoder);
|
||||
}
|
||||
break;
|
||||
case GST_STATE_PAUSED_TO_PLAYING:
|
||||
flacdec->eos = FALSE;
|
||||
|
|
Loading…
Reference in a new issue