From: Wim T. <wt...@us...> - 2001-09-21 19:24:51
|
Update of /cvsroot/gstreamer/gstreamer/plugins/avi In directory usw-pr-cvs1:/tmp/cvs-serv22478 Modified Files: Tag: BRANCH-EVENTS1 gstavidemux.c gstavidemux.h Log Message: Some more avi demuxer fixes (deal with 0 sized buffers) Index: gstavidemux.c =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/plugins/avi/gstavidemux.c,v retrieving revision 1.9.4.3 retrieving revision 1.9.4.4 diff -u -d -r1.9.4.3 -r1.9.4.4 --- gstavidemux.c 2001/09/17 00:16:16 1.9.4.3 +++ gstavidemux.c 2001/09/21 19:24:47 1.9.4.4 @@ -549,19 +549,24 @@ if (GST_PAD_CONNECTED (avi_demux->video_pad[0])) { GstBuffer *buf; - buf = gst_bytestream_peek (bs, *chunksize); + if (*chunksize) { + buf = gst_bytestream_peek (bs, *chunksize); + } + else { + buf = gst_buffer_new (); + } GST_BUFFER_TIMESTAMP (buf) = avi_demux->next_time; avi_demux->next_time += avi_demux->time_interval; if (avi_demux->video_need_flush[0]) { avi_demux->video_need_flush[0] = FALSE; - GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLUSH); + GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLUSH); } GST_DEBUG (0,"gst_avi_demux_chain: send video buffer %08x\n", *chunksize); gst_pad_push(avi_demux->video_pad[0], buf); GST_DEBUG (0,"gst_avi_demux_chain: sent video buffer %08x %p\n", - *chunksize, &avi_demux->video_pad[0]); + *chunksize, &avi_demux->video_pad[0]); avi_demux->current_frame++; } *chunksize = (*chunksize + 1) & ~1; @@ -575,7 +580,12 @@ if (GST_PAD_CONNECTED (avi_demux->audio_pad[0])) { GstBuffer *buf; - buf = gst_bytestream_peek (bs, *chunksize); + if (*chunksize) { + buf = gst_bytestream_peek (bs, *chunksize); + } + else { + buf = gst_buffer_new (); + } if (avi_demux->audio_need_flush[0]) { GST_DEBUG (0,"audio flush\n"); Index: gstavidemux.h =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/plugins/avi/gstavidemux.h,v retrieving revision 1.3.4.2 retrieving revision 1.3.4.3 diff -u -d -r1.3.4.2 -r1.3.4.3 --- gstavidemux.h 2001/09/16 18:41:37 1.3.4.2 +++ gstavidemux.h 2001/09/21 19:24:47 1.3.4.3 @@ -27,7 +27,6 @@ #include <libs/riff/gstriff.h> #include <libs/bytestream/gstbytestream.h> - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ |