Mercurial > libavformat.hg
comparison utils.c @ 2023:a3e79d6e4e3c libavformat
add an enum for need_parsing
| author | aurel |
|---|---|
| date | Sun, 15 Apr 2007 13:51:57 +0000 |
| parents | d0d39f124c6b |
| children | 9a8908eaa2ea |
comparison
equal
deleted
inserted
replaced
| 2022:4f62a7d9381a | 2023:a3e79d6e4e3c |
|---|---|
| 780 s->cur_len = s->cur_pkt.size; | 780 s->cur_len = s->cur_pkt.size; |
| 781 if (st->need_parsing && !st->parser) { | 781 if (st->need_parsing && !st->parser) { |
| 782 st->parser = av_parser_init(st->codec->codec_id); | 782 st->parser = av_parser_init(st->codec->codec_id); |
| 783 if (!st->parser) { | 783 if (!st->parser) { |
| 784 /* no parser available : just output the raw packets */ | 784 /* no parser available : just output the raw packets */ |
| 785 st->need_parsing = 0; | 785 st->need_parsing = AVSTREAM_PARSE_NONE; |
| 786 }else if(st->need_parsing == 2){ | 786 }else if(st->need_parsing == AVSTREAM_PARSE_HEADERS){ |
| 787 st->parser->flags |= PARSER_FLAG_COMPLETE_FRAMES; | 787 st->parser->flags |= PARSER_FLAG_COMPLETE_FRAMES; |
| 788 } | 788 } |
| 789 if(st->parser && (s->iformat->flags & AVFMT_GENERIC_INDEX)){ | 789 if(st->parser && (s->iformat->flags & AVFMT_GENERIC_INDEX)){ |
| 790 st->parser->last_frame_offset= | 790 st->parser->last_frame_offset= |
| 791 st->parser->cur_offset= s->cur_pkt.pos; | 791 st->parser->cur_offset= s->cur_pkt.pos; |
| 1702 st->codec->time_base= st->time_base; | 1702 st->codec->time_base= st->time_base; |
| 1703 } | 1703 } |
| 1704 //only for the split stuff | 1704 //only for the split stuff |
| 1705 if (!st->parser) { | 1705 if (!st->parser) { |
| 1706 st->parser = av_parser_init(st->codec->codec_id); | 1706 st->parser = av_parser_init(st->codec->codec_id); |
| 1707 if(st->need_parsing == 2 && st->parser){ | 1707 if(st->need_parsing == AVSTREAM_PARSE_HEADERS && st->parser){ |
| 1708 st->parser->flags |= PARSER_FLAG_COMPLETE_FRAMES; | 1708 st->parser->flags |= PARSER_FLAG_COMPLETE_FRAMES; |
| 1709 } | 1709 } |
| 1710 } | 1710 } |
| 1711 } | 1711 } |
| 1712 | 1712 |
| 1905 } | 1905 } |
| 1906 }else if(st->codec->codec_type == CODEC_TYPE_AUDIO) { | 1906 }else if(st->codec->codec_type == CODEC_TYPE_AUDIO) { |
| 1907 if (st->codec->codec_id == CODEC_ID_NONE) { | 1907 if (st->codec->codec_id == CODEC_ID_NONE) { |
| 1908 codec_identified[st->index] = set_codec_from_probe_data(st, &(probe_data[st->index]), 0); | 1908 codec_identified[st->index] = set_codec_from_probe_data(st, &(probe_data[st->index]), 0); |
| 1909 if (codec_identified[st->index]) { | 1909 if (codec_identified[st->index]) { |
| 1910 st->need_parsing = 1; | 1910 st->need_parsing = AVSTREAM_PARSE_FULL; |
| 1911 } | 1911 } |
| 1912 } | 1912 } |
| 1913 if(!st->codec->bits_per_sample) | 1913 if(!st->codec->bits_per_sample) |
| 1914 st->codec->bits_per_sample= av_get_bits_per_sample(st->codec->codec_id); | 1914 st->codec->bits_per_sample= av_get_bits_per_sample(st->codec->codec_id); |
| 1915 } | 1915 } |
