changeset 5496:f966fc154841 libavcodec

make wmv1 and wmv2 playable with M$ DMO decoder
author michael
date Sun, 05 Aug 2007 20:03:37 +0000
parents 15c6ea63cb62
children 377e9152aa9b
files msmpeg4.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/msmpeg4.c	Sun Aug 05 19:36:35 2007 +0000
+++ b/msmpeg4.c	Sun Aug 05 20:03:37 2007 +0000
@@ -883,7 +883,7 @@
         } else {
             rl = &rl_table[3 + s->rl_chroma_table_index];
         }
-        run_diff = s->msmpeg4_version>=6;
+        run_diff = s->msmpeg4_version>=4;
         scantable= s->intra_scantable.permutated;
     } else {
         i = 0;
@@ -942,6 +942,9 @@
                     run1 = run - rl->max_run[last][level] - run_diff;
                     if (run1 < 0)
                         goto esc3;
+                    code = get_rl_index(rl, last, run1+1, level);
+                    if (s->msmpeg4_version == 4 && code == rl->n)
+                        goto esc3;
                     code = get_rl_index(rl, last, run1, level);
                     if (code == rl->n) {
                     esc3:
@@ -1641,7 +1644,7 @@
         }
         block[0] = level;
 
-        run_diff = 0;
+        run_diff = s->msmpeg4_version >= 4;
         i = 0;
         if (!coded) {
             goto not_coded;