summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristophe Thommeret <hftom@free.fr>2010-06-23 01:33:10 +0200
committerChristophe Thommeret <hftom@free.fr>2010-06-23 01:33:10 +0200
commit2da6d35b54cfa2afabc78510d73bfca1181700aa (patch)
treee049496acee7b9770bf1f99df6745c6cbe189ee7 /src
parent0532ad623ceaf190ec0863eba1914ef59eb124b6 (diff)
downloadxine-lib-2da6d35b54cfa2afabc78510d73bfca1181700aa.tar.gz
xine-lib-2da6d35b54cfa2afabc78510d73bfca1181700aa.tar.bz2
fix vc1 regression
Diffstat (limited to 'src')
-rw-r--r--src/video_dec/libvdpau/vdpau_vc1.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/src/video_dec/libvdpau/vdpau_vc1.c b/src/video_dec/libvdpau/vdpau_vc1.c
index 975449c47..1ba986050 100644
--- a/src/video_dec/libvdpau/vdpau_vc1.c
+++ b/src/video_dec/libvdpau/vdpau_vc1.c
@@ -22,7 +22,7 @@
*
*/
-/*#define LOG*/
+#define LOG
#define LOG_MODULE "vdpau_vc1"
#ifdef HAVE_CONFIG_H
@@ -920,11 +920,6 @@ static void vdpau_vc1_decode_data (video_decoder_t *this_gen, buf_element_t *buf
lprintf("arx=%d ary=%d ratio=%f\n", buf->decoder_info[1], buf->decoder_info[2], seq->ratio);
}
- if (buf->decoder_flags & BUF_FLAG_FRAME_START) {
- lprintf("BUF_FLAG_FRAME_START\n");
- seq->seq_pts = buf->pts;
- }
-
if ( !buf->size )
return;
@@ -953,6 +948,26 @@ static void vdpau_vc1_decode_data (video_decoder_t *this_gen, buf_element_t *buf
xine_fast_memcpy( seq->buf+seq->bufpos, buf->content, buf->size );
seq->bufpos += buf->size;
+ if (buf->decoder_flags & BUF_FLAG_FRAME_START) {
+ lprintf("BUF_FLAG_FRAME_START\n");
+ seq->seq_pts = buf->pts;
+ seq->mode = MODE_FRAME;
+ if ( seq->bufpos > 3 ) {
+ if ( seq->buf[0]==0 && seq->buf[1]==0 && seq->buf[2]==1 ) {
+ seq->mode = MODE_STARTCODE;
+ }
+ }
+ }
+
+ if ( seq->mode == MODE_FRAME ) {
+ if ( buf->decoder_flags & BUF_FLAG_FRAME_END ) {
+ lprintf("BUF_FLAG_FRAME_END\n");
+ decode_picture( this );
+ seq->bufpos = 0;
+ }
+ return;
+ }
+
int res, startcode=0;
while ( seq->bufseek <= seq->bufpos-4 ) {
uint8_t *buffer = seq->buf+seq->bufseek;
@@ -987,13 +1002,6 @@ static void vdpau_vc1_decode_data (video_decoder_t *this_gen, buf_element_t *buf
}
++seq->bufseek;
}
-
- if ( !startcode && (seq->start < 0) && (buf->decoder_flags & BUF_FLAG_FRAME_END) ) {
- lprintf("BUF_FLAG_FRAME_END\n");
- seq->mode = MODE_FRAME;
- decode_picture( this );
- seq->bufpos = 0;
- }
}