Mercurial > libavformat.hg
comparison avformat.h @ 3698:b7e347127897 libavformat
Maintain pointer to end of AVFormatContext.packet_buffer list
This changes add_to_pktbuf() to maintain a pointer to the last entry
in the list, avoiding a linear walk-through on each call. Before this
change, add_to_pktbuf() could take a significant amount of time (10%
of total decoding time), even with input files of several minutes.
After the change, the time spent in this function is barely measurable
with oprofile.
author | mru |
---|---|
date | Wed, 06 Aug 2008 22:17:38 +0000 |
parents | 74fbde8871c4 |
children | 5cf9918994ed |
comparison
equal
deleted
inserted
replaced
3697:c458ae91b0f9 | 3698:b7e347127897 |
---|---|
20 | 20 |
21 #ifndef FFMPEG_AVFORMAT_H | 21 #ifndef FFMPEG_AVFORMAT_H |
22 #define FFMPEG_AVFORMAT_H | 22 #define FFMPEG_AVFORMAT_H |
23 | 23 |
24 #define LIBAVFORMAT_VERSION_MAJOR 52 | 24 #define LIBAVFORMAT_VERSION_MAJOR 52 |
25 #define LIBAVFORMAT_VERSION_MINOR 18 | 25 #define LIBAVFORMAT_VERSION_MINOR 19 |
26 #define LIBAVFORMAT_VERSION_MICRO 0 | 26 #define LIBAVFORMAT_VERSION_MICRO 0 |
27 | 27 |
28 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ | 28 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ |
29 LIBAVFORMAT_VERSION_MINOR, \ | 29 LIBAVFORMAT_VERSION_MINOR, \ |
30 LIBAVFORMAT_VERSION_MICRO) | 30 LIBAVFORMAT_VERSION_MICRO) |
563 * This buffer is used for buffering packets until the codec can | 563 * This buffer is used for buffering packets until the codec can |
564 * be identified, as parsing cannot be done without knowing the | 564 * be identified, as parsing cannot be done without knowing the |
565 * codec. | 565 * codec. |
566 */ | 566 */ |
567 struct AVPacketList *raw_packet_buffer; | 567 struct AVPacketList *raw_packet_buffer; |
568 struct AVPacketList *raw_packet_buffer_end; | |
569 | |
570 struct AVPacketList *packet_buffer_end; | |
568 } AVFormatContext; | 571 } AVFormatContext; |
569 | 572 |
570 typedef struct AVPacketList { | 573 typedef struct AVPacketList { |
571 AVPacket pkt; | 574 AVPacket pkt; |
572 struct AVPacketList *next; | 575 struct AVPacketList *next; |