Revision 5c5b1731

View differences:

libavformat/avformat.h
22 22
#define FFMPEG_AVFORMAT_H
23 23

  
24 24
#define LIBAVFORMAT_VERSION_MAJOR 52
25
#define LIBAVFORMAT_VERSION_MINOR 18
25
#define LIBAVFORMAT_VERSION_MINOR 19
26 26
#define LIBAVFORMAT_VERSION_MICRO  0
27 27

  
28 28
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
......
565 565
     * codec.
566 566
     */
567 567
    struct AVPacketList *raw_packet_buffer;
568
    struct AVPacketList *raw_packet_buffer_end;
569

  
570
    struct AVPacketList *packet_buffer_end;
568 571
} AVFormatContext;
569 572

  
570 573
typedef struct AVPacketList {
libavformat/utils.c
524 524

  
525 525
/*******************************************************/
526 526

  
527
static AVPacket *add_to_pktbuf(AVPacketList **packet_buffer, AVPacket *pkt){
528
    AVPacketList *pktl;
529
    AVPacketList **plast_pktl= packet_buffer;
530

  
531
    while(*plast_pktl) plast_pktl= &(*plast_pktl)->next; //FIXME maybe maintain pointer to the last?
532

  
533
    pktl = av_mallocz(sizeof(AVPacketList));
527
static AVPacket *add_to_pktbuf(AVPacketList **packet_buffer, AVPacket *pkt,
528
                               AVPacketList **plast_pktl){
529
    AVPacketList *pktl = av_mallocz(sizeof(AVPacketList));
534 530
    if (!pktl)
535 531
        return NULL;
536 532

  
533
    if (*packet_buffer)
534
        (*plast_pktl)->next = pktl;
535
    else
536
        *packet_buffer = pktl;
537

  
537 538
    /* add the packet in the buffered packet list */
538 539
    *plast_pktl = pktl;
539 540
    pktl->pkt= *pkt;
......
578 579
        if(!pktl && st->codec->codec_id!=CODEC_ID_PROBE)
579 580
            return ret;
580 581

  
581
        add_to_pktbuf(&s->raw_packet_buffer, pkt);
582
        add_to_pktbuf(&s->raw_packet_buffer, pkt, &s->raw_packet_buffer_end);
582 583

  
583 584
        if(st->codec->codec_id == CODEC_ID_PROBE){
584 585
            AVProbeData *pd = &st->probe_data;
......
1043 1044
                    return ret;
1044 1045
            }
1045 1046

  
1046
            if(av_dup_packet(add_to_pktbuf(&s->packet_buffer, pkt)) < 0)
1047
            if(av_dup_packet(add_to_pktbuf(&s->packet_buffer, pkt,
1048
                                           &s->packet_buffer_end)) < 0)
1047 1049
                return AVERROR(ENOMEM);
1048 1050
        }else{
1049 1051
            assert(!s->packet_buffer);
......
2021 2023
            break;
2022 2024
        }
2023 2025

  
2024
        pkt= add_to_pktbuf(&ic->packet_buffer, &pkt1);
2026
        pkt= add_to_pktbuf(&ic->packet_buffer, &pkt1, &ic->packet_buffer_end);
2025 2027
        if(av_dup_packet(pkt) < 0) {
2026 2028
            av_free(duration_error);
2027 2029
            return AVERROR(ENOMEM);

Also available in: Unified diff