| OLD | NEW |
| 1 /* | 1 /* |
| 2 * MPEG2 transport stream (aka DVB) demuxer | 2 * MPEG2 transport stream (aka DVB) demuxer |
| 3 * Copyright (c) 2002-2003 Fabrice Bellard | 3 * Copyright (c) 2002-2003 Fabrice Bellard |
| 4 * | 4 * |
| 5 * This file is part of FFmpeg. | 5 * This file is part of FFmpeg. |
| 6 * | 6 * |
| 7 * FFmpeg is free software; you can redistribute it and/or | 7 * FFmpeg is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Lesser General Public | 8 * modify it under the terms of the GNU Lesser General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2.1 of the License, or (at your option) any later version. | 10 * version 2.1 of the License, or (at your option) any later version. |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 decide */ | 675 decide */ |
| 676 #if 0 | 676 #if 0 |
| 677 av_hex_dump_log(pes->stream, AV_LOG_DEBUG, pes->header, pes->dat
a_index); | 677 av_hex_dump_log(pes->stream, AV_LOG_DEBUG, pes->header, pes->dat
a_index); |
| 678 #endif | 678 #endif |
| 679 if (pes->header[0] == 0x00 && pes->header[1] == 0x00 && | 679 if (pes->header[0] == 0x00 && pes->header[1] == 0x00 && |
| 680 pes->header[2] == 0x01) { | 680 pes->header[2] == 0x01) { |
| 681 /* it must be an mpeg2 PES stream */ | 681 /* it must be an mpeg2 PES stream */ |
| 682 code = pes->header[3] | 0x100; | 682 code = pes->header[3] | 0x100; |
| 683 dprintf(pes->stream, "pid=%x pes_code=%#x\n", pes->pid, code
); | 683 dprintf(pes->stream, "pid=%x pes_code=%#x\n", pes->pid, code
); |
| 684 | 684 |
| 685 if ((!pes->st && pes->stream->nb_streams == MAX_STREAMS) || | 685 if ((pes->st && pes->st->discard == AVDISCARD_ALL) || |
| 686 (pes->st && pes->st->discard == AVDISCARD_ALL) || | |
| 687 code == 0x1be) /* padding_stream */ | 686 code == 0x1be) /* padding_stream */ |
| 688 goto skip; | 687 goto skip; |
| 689 | 688 |
| 689 #if FF_API_MAX_STREAMS |
| 690 if (!pes->st && pes->stream->nb_streams == MAX_STREAMS) |
| 691 goto skip; |
| 692 #endif |
| 693 |
| 690 /* stream not present in PMT */ | 694 /* stream not present in PMT */ |
| 691 if (!pes->st) { | 695 if (!pes->st) { |
| 692 pes->st = av_new_stream(ts->stream, pes->pid); | 696 pes->st = av_new_stream(ts->stream, pes->pid); |
| 693 if (!pes->st) | 697 if (!pes->st) |
| 694 return AVERROR(ENOMEM); | 698 return AVERROR(ENOMEM); |
| 695 mpegts_set_stream_info(pes->st, pes, 0, 0); | 699 mpegts_set_stream_info(pes->st, pes, 0, 0); |
| 696 } | 700 } |
| 697 | 701 |
| 698 pes->total_size = AV_RB16(pes->header + 4); | 702 pes->total_size = AV_RB16(pes->header + 4); |
| 699 /* NOTE: a zero total size means the PES size is | 703 /* NOTE: a zero total size means the PES size is |
| (...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1784 mpegts_read_header, | 1788 mpegts_read_header, |
| 1785 mpegts_raw_read_packet, | 1789 mpegts_raw_read_packet, |
| 1786 mpegts_read_close, | 1790 mpegts_read_close, |
| 1787 read_seek, | 1791 read_seek, |
| 1788 mpegts_get_pcr, | 1792 mpegts_get_pcr, |
| 1789 .flags = AVFMT_SHOW_IDS|AVFMT_TS_DISCONT, | 1793 .flags = AVFMT_SHOW_IDS|AVFMT_TS_DISCONT, |
| 1790 #ifdef USE_SYNCPOINT_SEARCH | 1794 #ifdef USE_SYNCPOINT_SEARCH |
| 1791 .read_seek2 = read_seek2, | 1795 .read_seek2 = read_seek2, |
| 1792 #endif | 1796 #endif |
| 1793 }; | 1797 }; |
| OLD | NEW |