summaryrefslogtreecommitdiff
path: root/libavcodec/cavsdec.c
diff options
context:
space:
mode:
authorStefan Gehrer <stefan.gehrer@gmx.de>2010-02-15 16:43:45 +0000
committerStefan Gehrer <stefan.gehrer@gmx.de>2010-02-15 16:43:45 +0000
commit35122bd93e7f3e08b42fbbed2e9b5c7ac5c1f4f5 (patch)
tree2c1f8983898c31eceb394a01956a583d53975b60 /libavcodec/cavsdec.c
parent026b9d3c5a2460f492b96a7e37758324cc729e7e (diff)
add heuristic to discern the old sample clips from streams encoded
with rm52j encoder, a marker_bit has been added in the I-Frame syntax Originally committed as revision 21836 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/cavsdec.c')
-rw-r--r--libavcodec/cavsdec.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index 458fcf2bb5..5929c8e2fb 100644
--- a/libavcodec/cavsdec.c
+++ b/libavcodec/cavsdec.c
@@ -483,6 +483,15 @@ static int decode_pic(AVSContext *h) {
h->pic_type = FF_I_TYPE;
if(get_bits1(&s->gb))
skip_bits(&s->gb,24);//time_code
+ /* old sample clips were all progressive and no low_delay,
+ bump stream revision if detected otherwise */
+ if((s->low_delay) || !(show_bits(&s->gb,9) & 1))
+ h->stream_revision = 1;
+ /* similarly test top_field_first and repeat_first_field */
+ else if(show_bits(&s->gb,11) & 3)
+ h->stream_revision = 1;
+ if(h->stream_revision > 0)
+ skip_bits(&s->gb,1); //marker_bit
}
/* release last B frame */
if(h->picture.data[0])