[FFmpeg-cvslog] dvbsubdec: move shared codepath

Vittorio Giovara git at videolan.org
Tue Nov 11 23:15:00 CET 2014


ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Sun Nov  9 08:48:45 2014 +0100| [443502aed8b814d883825e52e91e4f018955aa66] | committer: Vittorio Giovara

dvbsubdec: move shared codepath

CC: libav-stable at libav.org
Bug-Id: CID 1238839

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=443502aed8b814d883825e52e91e4f018955aa66
---

 libavcodec/dvbsubdec.c |   23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index 839465b..3d6e313 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -693,26 +693,19 @@ static int dvbsub_read_8bit_string(uint8_t *destbuf, int dbuf_len,
                 if (run_length == 0) {
                     return pixels_read;
                 }
-
-                if (map_table)
-                    bits = map_table[0];
-                else
-                    bits = 0;
-                while (run_length-- > 0 && pixels_read < dbuf_len) {
-                    *destbuf++ = bits;
-                    pixels_read++;
-                }
             } else {
                 bits = *(*srcbuf)++;
 
                 if (non_mod == 1 && bits == 1)
                     pixels_read += run_length;
-                if (map_table)
-                    bits = map_table[bits];
-                else while (run_length-- > 0 && pixels_read < dbuf_len) {
-                    *destbuf++ = bits;
-                    pixels_read++;
-                }
+            }
+            if (map_table)
+                bits = map_table[0];
+            else
+                bits = 0;
+            while (run_length-- > 0 && pixels_read < dbuf_len) {
+                *destbuf++ = bits;
+                pixels_read++;
             }
         }
     }



More information about the ffmpeg-cvslog mailing list