diff options
author | Reinhard Nißl <rnissl@gmx.de> | 2008-12-27 10:18:47 +0000 |
---|---|---|
committer | Reinhard Nißl <rnissl@gmx.de> | 2008-12-27 10:18:47 +0000 |
commit | d05b6585a92b76f4d9cba67e4674b5bfdefc69c2 (patch) | |
tree | 64bb89682f5eb2654a8e02f538a0598a997d8f23 /src | |
parent | 8ab46aacc70273916ed362fb712736ec1f2db62d (diff) | |
download | xine-lib-d05b6585a92b76f4d9cba67e4674b5bfdefc69c2.tar.gz xine-lib-d05b6585a92b76f4d9cba67e4674b5bfdefc69c2.tar.bz2 |
Add still image support.
Diffstat (limited to 'src')
-rw-r--r-- | src/libvdpau/vdpau_mpeg12.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/libvdpau/vdpau_mpeg12.c b/src/libvdpau/vdpau_mpeg12.c index fa20f8579..fc7221019 100644 --- a/src/libvdpau/vdpau_mpeg12.c +++ b/src/libvdpau/vdpau_mpeg12.c @@ -754,7 +754,7 @@ static void vdpau_mpeg12_decode_data (video_decoder_t *this_gen, buf_element_t * xine_fast_memcpy( seq->buf+seq->bufpos, buf->content, buf->size ); seq->bufpos += buf->size; - while ( seq->bufseek < seq->bufpos-4 ) { + while ( seq->bufseek <= seq->bufpos-4 ) { uint8_t *buf = seq->buf+seq->bufseek; if ( buf[0]==0 && buf[1]==0 && buf[2]==1 ) { if ( seq->start<0 ) { @@ -777,6 +777,14 @@ static void vdpau_mpeg12_decode_data (video_decoder_t *this_gen, buf_element_t * ++seq->bufseek; } + /* still image detection -- don't wait for further data if buffer ends in sequence end code */ + if (seq->start >= 0 && seq->buf[seq->start + 3] == sequence_end_code) { + if (parse_code(this, seq->buf+seq->start, 4)) { + decode_picture(this); + parse_code(this, seq->buf+seq->start, 4); + } + seq->start = -1; + } } /* @@ -786,7 +794,8 @@ static void vdpau_mpeg12_flush (video_decoder_t *this_gen) { vdpau_mpeg12_decoder_t *this = (vdpau_mpeg12_decoder_t *) this_gen; printf( "vdpau_mpeg12: vdpau_mpeg12_flush\n" ); - reset_sequence( &this->sequence ); +// incorrect: see libmpeg2, mpeg2_flush() +// reset_sequence( &this->sequence ); } /* |