]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mpegvideo_parser.c
ac3enc: Add codec-specific options for writing AC-3 metadata.
[ffmpeg] / libavcodec / mpegvideo_parser.c
index df998a3a37b9caa2f35c39cb8b731a2d99a02c2b..8115df54faaad8056e2ecc1e0a4eaae521ca01c8 100644 (file)
@@ -3,20 +3,20 @@
  * Copyright (c) 2000,2001 Fabrice Bellard
  * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
  *
- * This file is part of FFmpeg.
+ * This file is part of Libav.
  *
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
@@ -28,7 +28,7 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
                                       const uint8_t *buf, int buf_size)
 {
     ParseContext1 *pc = s->priv_data;
-    const uint8_t *buf_end;
+    const uint8_t *buf_end = buf + buf_size;
     uint32_t start_code;
     int frame_rate_index, ext_type, bytes_left;
     int frame_rate_ext_n, frame_rate_ext_d;
@@ -37,7 +37,7 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
     int did_set_size=0;
 //FIXME replace the crap with get_bits()
     s->repeat_pict = 0;
-    buf_end = buf + buf_size;
+
     while (buf < buf_end) {
         start_code= -1;
         buf= ff_find_start_code(buf, buf_end, &start_code);
@@ -176,10 +176,11 @@ static int mpegvideo_split(AVCodecContext *avctx,
     return 0;
 }
 
-AVCodecParser mpegvideo_parser = {
+AVCodecParser ff_mpegvideo_parser = {
     { CODEC_ID_MPEG1VIDEO, CODEC_ID_MPEG2VIDEO },
     sizeof(ParseContext1),
     NULL,
     mpegvideo_parse,
     ff_parse1_close,
+    mpegvideo_split,
 };