changeset 842:43210d766412 libavformat

parse pict_type for streams in avi fix mpeg4 parser so it outputs te pict_type support header only parseing without repacking
author michael
date Mon, 15 Aug 2005 15:58:21 +0000
parents ba7631ba33a7
children dcf6e35ddb72
files avformat.h avidec.c utils.c
diffstat 3 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/avformat.h	Mon Aug 15 14:22:43 2005 +0000
+++ b/avformat.h	Mon Aug 15 15:58:21 2005 +0000
@@ -248,7 +248,7 @@
     char language[4]; /* ISO 639 3-letter language code (empty string if undefined) */
 
     /* av_read_frame() support */
-    int need_parsing;
+    int need_parsing;                  ///< 1->full parsing needed, 2->only parse headers dont repack
     struct AVCodecParserContext *parser;
 
     int64_t cur_dts;
--- a/avidec.c	Mon Aug 15 14:22:43 2005 +0000
+++ b/avidec.c	Mon Aug 15 15:58:21 2005 +0000
@@ -302,6 +302,7 @@
                     st->codec->codec_id = codec_get_id(codec_bmp_tags, tag1);
                     if (st->codec->codec_id == CODEC_ID_XAN_WC4)
                         xan_video = 1;
+                    st->need_parsing = 2; //only parse headers dont do slower repacketization, this is needed to get the pict type which is needed for generating correct pts
 //                    url_fskip(pb, size - 5 * 4);
                     break;
                 case CODEC_TYPE_AUDIO:
--- a/utils.c	Mon Aug 15 14:22:43 2005 +0000
+++ b/utils.c	Mon Aug 15 15:58:21 2005 +0000
@@ -927,6 +927,8 @@
                 if (!st->parser) {
                     /* no parser available : just output the raw packets */
                     st->need_parsing = 0;
+                }else if(st->need_parsing == 2){
+                    st->parser->flags |= PARSER_FLAG_COMPLETE_FRAMES;
                 }
             }
         }
@@ -1846,6 +1848,9 @@
         //only for the split stuff
         if (!st->parser) {
             st->parser = av_parser_init(st->codec->codec_id);
+            if(st->need_parsing == 2 && st->parser){
+                st->parser->flags |= PARSER_FLAG_COMPLETE_FRAMES;
+            }
         }
     }