summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-01-18 01:24:59 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-01-18 01:24:59 +0000
commit3673ad9b77d43e0202d350bad8ecbcdf6d9bb161 (patch)
tree2db1450135445da694acc1b3119f6d40fb0195e4 /src
parentea2417cc719e7c4dfd125c765badf92bd4f55de3 (diff)
downloadxine-lib-3673ad9b77d43e0202d350bad8ecbcdf6d9bb161.tar.gz
xine-lib-3673ad9b77d43e0202d350bad8ecbcdf6d9bb161.tar.bz2
enable divx playing on slow machines! (by skipping frames when late)
CVS patchset: 1421 CVS date: 2002/01/18 01:24:59
Diffstat (limited to 'src')
-rw-r--r--src/libffmpeg/xine_decoder.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/libffmpeg/xine_decoder.c b/src/libffmpeg/xine_decoder.c
index 640d02d17..573719a97 100644
--- a/src/libffmpeg/xine_decoder.c
+++ b/src/libffmpeg/xine_decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_decoder.c,v 1.23 2002/01/15 17:30:51 miguelfreitas Exp $
+ * $Id: xine_decoder.c,v 1.24 2002/01/18 01:24:59 miguelfreitas Exp $
*
* xine decoder plugin using ffmpeg
*
@@ -74,6 +74,7 @@ typedef struct ff_decoder_s {
unsigned char *buf;
int bufsize;
int size;
+ int skipframes;
AVPicture av_picture;
AVCodecContext context;
@@ -209,6 +210,8 @@ static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
this->buf = malloc( VIDEOBUFSIZE );
this->bufsize = VIDEOBUFSIZE;
+ this->skipframes = 0;
+
} else if (this->decoder_ok) {
if( this->size + buf->size > this->bufsize ) {
@@ -249,8 +252,9 @@ static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
VO_BOTH_FIELDS);
img->PTS = buf->PTS;
- if (len<0) {
- printf ("ffmpeg: error decompressing frame\n");
+ if (len<0 || this->skipframes) {
+ if( !this->skipframes )
+ printf ("ffmpeg: error decompressing frame\n");
img->bad_frame = 1;
} else {
img->bad_frame = 0;
@@ -330,7 +334,10 @@ static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
}
}
}
- img->draw(img);
+
+ this->skipframes = img->draw(img);
+ if( this->skipframes < 0 )
+ this->skipframes = 0;
img->free(img);
this->size = 0;