changeset 467:40069a91d1a0 libavformat

dont add padding in the middle of the data patch by (Sidik Isani <isani at cfht dot hawaii dot edu>)
author michael
date Tue, 25 May 2004 23:06:00 +0000
parents 0dd5b381fc9a
children 60f897e8dd2d
files mpeg.c
diffstat 1 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/mpeg.c	Mon May 24 15:13:23 2004 +0000
+++ b/mpeg.c	Tue May 25 23:06:00 2004 +0000
@@ -730,6 +730,15 @@
             }
         }
 
+        if (s->is_mpeg2) {
+            /* special stuffing byte that is always written
+               to prevent accidental generation of start codes. */
+            put_byte(&ctx->pb, 0xff);
+
+            for(i=0;i<stuffing_size;i++)
+                put_byte(&ctx->pb, 0xff);
+        }
+
         if (startcode == PRIVATE_STREAM_1) {
             put_byte(&ctx->pb, id);
             if (id >= 0xa0) {
@@ -746,15 +755,6 @@
             }
         }
 
-        if (s->is_mpeg2) {
-            /* special stuffing byte that is always written
-               to prevent accidental generation of start codes. */
-            put_byte(&ctx->pb, 0xff);
-
-            for(i=0;i<stuffing_size;i++)
-                put_byte(&ctx->pb, 0xff);
-        }
-
         /* output data */
         put_buffer(&ctx->pb, stream->buffer, payload_size - stuffing_size);
     }