diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-03-04 15:49:26 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-03-05 18:47:05 +0100 |
commit | 27c7ca9c12bb42d5c44d46f24cd970469d0ef55a (patch) | |
tree | 919bcdcd0a17451b2d79edc121a4c05f57ffe86e /libavformat/avformat.h | |
parent | dcee811505b9f95edad73526d94cabc99331b659 (diff) | |
download | ffmpeg-27c7ca9c12bb42d5c44d46f24cd970469d0ef55a.tar.gz |
lavf: deobfuscate read_frame_internal().
Split off packet parsing into a separate function. Parse full packets at
once and store them in a queue, eliminating the need for tracking
parsing state in AVStream.
The horrible unreadable loop in read_frame_internal() now isn't weirdly
ordered and doesn't contain evil gotos, so it should be much easier to
understand.
compute_pkt_fields() now invents slightly different timestamps for two
raw vc1 tests, due to has_b_frames being set a bit later. They shouldn't
be more wrong (or right) than previous ones.
Diffstat (limited to 'libavformat/avformat.h')
-rw-r--r-- | libavformat/avformat.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 65ed376c89..9b40eee395 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -639,10 +639,6 @@ typedef struct AVStream { int nb_decoded_frames; } *info; - AVPacket cur_pkt; - const uint8_t *cur_ptr; - int cur_len; - int pts_wrap_bits; /**< number of bits in pts (used for wrapping control) */ // Timestamp generation support: @@ -922,9 +918,6 @@ typedef struct AVFormatContext { struct AVPacketList *packet_buffer; struct AVPacketList *packet_buffer_end; - /* av_read_frame() support */ - AVStream *cur_st; - /* av_seek_frame() support */ int64_t data_offset; /**< offset of the first packet */ @@ -937,6 +930,11 @@ typedef struct AVFormatContext { struct AVPacketList *raw_packet_buffer; struct AVPacketList *raw_packet_buffer_end; /** + * Packets split by the parser get queued here. + */ + struct AVPacketList *parse_queue; + struct AVPacketList *parse_queue_end; + /** * Remaining size available for raw_packet_buffer, in bytes. */ #define RAW_PACKET_BUFFER_SIZE 2500000 |