Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2005-08-15 19:58:21 +0400
committerMichael Niedermayer <michaelni@gmx.at>2005-08-15 19:58:21 +0400
commit7cbaa7bafa16b572aaae692722a9f8db90b65cb8 (patch)
tree050620b8c810b57d2d8d7f2997c6bc0ae511bd0d /libavformat
parent30bc6613fed9592e81b04818cb3e6c95088460d1 (diff)
parse pict_type for streams in avi
fix mpeg4 parser so it outputs te pict_type support header only parseing without repacking Originally committed as revision 4527 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/avformat.h2
-rw-r--r--libavformat/avidec.c1
-rw-r--r--libavformat/utils.c5
3 files changed, 7 insertions, 1 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 2b3937852a..e891b9768d 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -248,7 +248,7 @@ typedef struct AVStream {
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;
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 15bd18a375..01b1a9d8c9 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -302,6 +302,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
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:
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 5a81ee0680..eb19eea527 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -927,6 +927,8 @@ static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt)
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 @@ int av_find_stream_info(AVFormatContext *ic)
//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;
+ }
}
}