mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-18 20:25:25 +00:00
Drop the bytstream correctly.
Original commit message from CVS: Drop the bytstream correctly.
This commit is contained in:
parent
1f450bc6d8
commit
78c73a27b7
1 changed files with 10 additions and 3 deletions
|
@ -472,6 +472,11 @@ gst_flxdec_loop (GstElement *element)
|
||||||
if (flxdec->state == GST_FLXDEC_READ_HEADER) {
|
if (flxdec->state == GST_FLXDEC_READ_HEADER) {
|
||||||
databuf = flx_get_data(flxdec, FlxHeaderSize);
|
databuf = flx_get_data(flxdec, FlxHeaderSize);
|
||||||
|
|
||||||
|
if (!databuf) {
|
||||||
|
g_print ("empty buffer\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
data = GST_BUFFER_DATA(databuf);
|
data = GST_BUFFER_DATA(databuf);
|
||||||
|
|
||||||
memcpy((char *) &flxdec->hdr, data, sizeof(FlxHeader));
|
memcpy((char *) &flxdec->hdr, data, sizeof(FlxHeader));
|
||||||
|
@ -483,8 +488,10 @@ gst_flxdec_loop (GstElement *element)
|
||||||
/* check header */
|
/* check header */
|
||||||
if (flxh->type != FLX_MAGICHDR_FLI &&
|
if (flxh->type != FLX_MAGICHDR_FLI &&
|
||||||
flxh->type != FLX_MAGICHDR_FLC &&
|
flxh->type != FLX_MAGICHDR_FLC &&
|
||||||
flxh->type != FLX_MAGICHDR_FLX)
|
flxh->type != FLX_MAGICHDR_FLX) {
|
||||||
|
gst_element_error (element, "not a flx file (type %d)\n", flxh->type);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
g_print("GstFlxDec: size : %d\n", flxh->size);
|
g_print("GstFlxDec: size : %d\n", flxh->size);
|
||||||
|
@ -607,9 +614,9 @@ gst_flxdec_change_state (GstElement *element)
|
||||||
|
|
||||||
switch (GST_STATE_TRANSITION (element)) {
|
switch (GST_STATE_TRANSITION (element)) {
|
||||||
case GST_STATE_NULL_TO_READY:
|
case GST_STATE_NULL_TO_READY:
|
||||||
flxdec->bs = gst_bytestream_new (flxdec->sinkpad);
|
|
||||||
break;
|
break;
|
||||||
case GST_STATE_READY_TO_PAUSED:
|
case GST_STATE_READY_TO_PAUSED:
|
||||||
|
flxdec->bs = gst_bytestream_new (flxdec->sinkpad);
|
||||||
flxdec->state = GST_FLXDEC_READ_HEADER;
|
flxdec->state = GST_FLXDEC_READ_HEADER;
|
||||||
break;
|
break;
|
||||||
case GST_STATE_PAUSED_TO_PLAYING:
|
case GST_STATE_PAUSED_TO_PLAYING:
|
||||||
|
@ -621,9 +628,9 @@ gst_flxdec_change_state (GstElement *element)
|
||||||
flxdec->frame = NULL;
|
flxdec->frame = NULL;
|
||||||
gst_buffer_unref (flxdec->delta);
|
gst_buffer_unref (flxdec->delta);
|
||||||
flxdec->delta = NULL;
|
flxdec->delta = NULL;
|
||||||
|
gst_bytestream_destroy (flxdec->bs);
|
||||||
break;
|
break;
|
||||||
case GST_STATE_READY_TO_NULL:
|
case GST_STATE_READY_TO_NULL:
|
||||||
gst_bytestream_destroy (flxdec->bs);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue