Mercurial > libavformat.hg
comparison avidec.c @ 3984:46fc6e792241 libavformat
Favor even chunk sizes in ambiguous cases.
Fixes transcode_069_produces_uneven_chunk_size.avi.
author | michael |
---|---|
date | Sat, 04 Oct 2008 22:26:43 +0000 |
parents | 38269a4cfe68 |
children | b55158db61fa |
comparison
equal
deleted
inserted
replaced
3983:38269a4cfe68 | 3984:46fc6e792241 |
---|---|
50 typedef struct { | 50 typedef struct { |
51 int64_t riff_end; | 51 int64_t riff_end; |
52 int64_t movi_end; | 52 int64_t movi_end; |
53 int64_t fsize; | 53 int64_t fsize; |
54 int64_t movi_list; | 54 int64_t movi_list; |
55 int64_t last_pkt_pos; | |
55 int index_loaded; | 56 int index_loaded; |
56 int is_odml; | 57 int is_odml; |
57 int non_interleaved; | 58 int non_interleaved; |
58 int stream_index; | 59 int stream_index; |
59 DVDemuxContext* dv_demux; | 60 DVDemuxContext* dv_demux; |
699 else | 700 else |
700 size= ast->sample_size; | 701 size= ast->sample_size; |
701 | 702 |
702 if(size > ast->remaining) | 703 if(size > ast->remaining) |
703 size= ast->remaining; | 704 size= ast->remaining; |
705 avi->last_pkt_pos= url_ftell(pb); | |
704 av_get_packet(pb, pkt, size); | 706 av_get_packet(pb, pkt, size); |
705 | 707 |
706 if(ast->has_pal && pkt->data && pkt->size<(unsigned)INT_MAX/2){ | 708 if(ast->has_pal && pkt->data && pkt->size<(unsigned)INT_MAX/2){ |
707 ast->has_pal=0; | 709 ast->has_pal=0; |
708 pkt->size += 4*256; | 710 pkt->size += 4*256; |
779 //av_log(NULL, AV_LOG_DEBUG, "SKIP\n"); | 781 //av_log(NULL, AV_LOG_DEBUG, "SKIP\n"); |
780 goto resync; | 782 goto resync; |
781 } | 783 } |
782 | 784 |
783 n= get_stream_idx(d); | 785 n= get_stream_idx(d); |
786 | |
787 if(!((i-avi->last_pkt_pos)&1) && get_stream_idx(d+1) < s->nb_streams) | |
788 continue; | |
784 | 789 |
785 //parse ##dc/##wb | 790 //parse ##dc/##wb |
786 if(n < s->nb_streams){ | 791 if(n < s->nb_streams){ |
787 AVStream *st; | 792 AVStream *st; |
788 AVIStream *ast; | 793 AVIStream *ast; |