[SCM] libav/experimental: simplify bitstream reading

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:08:14 UTC 2013


The following commit has been merged in the experimental branch:
commit 269b94e34656eaf3f237ee1528826f3b9a1940cf
Author: Aurelien Jacobs <aurel at gnuage.org>
Date:   Mon Oct 15 22:47:41 2007 +0000

    simplify bitstream reading
    
    Originally committed as revision 10745 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c
index 871a2f7..19e12ed 100644
--- a/libavformat/electronicarts.c
+++ b/libavformat/electronicarts.c
@@ -83,22 +83,10 @@ static int process_ea_header(AVFormatContext *s) {
     EaDemuxContext *ea = s->priv_data;
     ByteIOContext *pb = &s->pb;
 
-    if (get_buffer(pb, (void*)&blockid, 4) != 4) {
+    if (get_le32(pb) != SCHl_TAG)
         return 0;
-    }
-    if (le2me_32(blockid) != SCHl_TAG) {
-        return 0;
-    }
-
-    if (get_buffer(pb, (void*)&size, 4) != 4) {
-        return 0;
-    }
-    size = le2me_32(size);
-
-    if (get_buffer(pb, (void*)&blockid, 4) != 4) {
-        return 0;
-    }
-    if (le2me_32(blockid) != PT00_TAG) {
+    size = get_le32(pb);
+    if (get_le32(pb) != PT00_TAG) {
         av_log (s, AV_LOG_ERROR, "PT header missing\n");
         return 0;
     }

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list