Mercurial > libavformat.hg
comparison avidec.c @ 3183:4ebe80ca2a2d libavformat
Support wb00+dc00 chunk mix.
fixes issue402
| author | michael |
|---|---|
| date | Thu, 27 Mar 2008 20:58:01 +0000 |
| parents | f5ee8f2afc83 |
| children | de03f6b32914 |
comparison
equal
deleted
inserted
replaced
| 3182:3cf24d58a8a9 | 3183:4ebe80ca2a2d |
|---|---|
| 776 } | 776 } |
| 777 | 777 |
| 778 //parse ##dc/##wb | 778 //parse ##dc/##wb |
| 779 if(n < s->nb_streams){ | 779 if(n < s->nb_streams){ |
| 780 AVStream *st; | 780 AVStream *st; |
| 781 AVStream *st1 = s->streams[1]; | |
| 782 AVIStream *ast1= st1->priv_data; | |
| 781 AVIStream *ast; | 783 AVIStream *ast; |
| 782 st = s->streams[n]; | 784 st = s->streams[n]; |
| 783 ast = st->priv_data; | 785 ast = st->priv_data; |
| 786 | |
| 787 | |
| 788 //workaround for broken small-file-bug402.avi | |
| 789 if( d[2] == 'w' && d[3] == 'b' | |
| 790 && n==0 | |
| 791 && s->nb_streams>=2 | |
| 792 && st ->codec->codec_type == CODEC_TYPE_VIDEO | |
| 793 && st1->codec->codec_type == CODEC_TYPE_AUDIO | |
| 794 && ast->prefix == 'd'*256+'c' | |
| 795 && (d[2]*256+d[3] == ast1->prefix || !ast1->prefix_count) | |
| 796 ){ | |
| 797 n=1; | |
| 798 st = st1; | |
| 799 ast = ast1; | |
| 800 av_log(s, AV_LOG_WARNING, "Invalid stream+prefix combination, assuming audio\n"); | |
| 801 } | |
| 802 | |
| 784 | 803 |
| 785 if( (st->discard >= AVDISCARD_DEFAULT && size==0) | 804 if( (st->discard >= AVDISCARD_DEFAULT && size==0) |
| 786 /*|| (st->discard >= AVDISCARD_NONKEY && !(pkt->flags & PKT_FLAG_KEY))*/ //FIXME needs a little reordering | 805 /*|| (st->discard >= AVDISCARD_NONKEY && !(pkt->flags & PKT_FLAG_KEY))*/ //FIXME needs a little reordering |
| 787 || st->discard >= AVDISCARD_ALL){ | 806 || st->discard >= AVDISCARD_ALL){ |
| 788 if(ast->sample_size) ast->frame_offset += pkt->size; | 807 if(ast->sample_size) ast->frame_offset += pkt->size; |
