Revision d23612ef

View differences:

libavformat/mpegts.c
553 553
    av_set_pts_info(st, 33, 1, 90000);
554 554
    st->priv_data = pes;
555 555
    st->codec->codec_type = CODEC_TYPE_DATA;
556
    st->codec->codec_id   = CODEC_ID_PROBE;
556
    st->codec->codec_id   = CODEC_ID_NONE;
557 557
    st->need_parsing = AVSTREAM_PARSE_FULL;
558 558
    pes->st = st;
559 559

  
......
564 564

  
565 565
    mpegts_find_stream_type(st, pes->stream_type, ISO_types);
566 566
    if (prog_reg_desc == AV_RL32("HDMV") &&
567
        st->codec->codec_id == CODEC_ID_PROBE)
567
        st->codec->codec_id == CODEC_ID_NONE)
568 568
        mpegts_find_stream_type(st, pes->stream_type, HDMV_types);
569
    if (st->codec->codec_id == CODEC_ID_PROBE)
569
    if (st->codec->codec_id == CODEC_ID_NONE)
570 570
        mpegts_find_stream_type(st, pes->stream_type, MISC_types);
571 571

  
572 572
    /* stream was not present in PMT, guess based on PES start code */
573
    if (st->codec->codec_id == CODEC_ID_PROBE) {
573
    if (st->codec->codec_id == CODEC_ID_NONE) {
574 574
        if (code >= 0x1c0 && code <= 0x1df) {
575 575
            st->codec->codec_type = CODEC_TYPE_AUDIO;
576 576
            st->codec->codec_id = CODEC_ID_MP2;
......
687 687
            dprintf(ts->stream, "tag: 0x%02x len=%d\n",
688 688
                   desc_tag, desc_len);
689 689

  
690
            if (st->codec->codec_id == CODEC_ID_PROBE &&
690
            if (st->codec->codec_id == CODEC_ID_NONE &&
691 691
                stream_type == STREAM_TYPE_PRIVATE_DATA)
692 692
                mpegts_find_stream_type(st, desc_tag, DESC_types);
693 693

  
......
713 713
            case 0x05: /* registration descriptor */
714 714
                st->codec->codec_tag = bytestream_get_le32(&p);
715 715
                dprintf(ts->stream, "reg_desc=%.4s\n", (char*)&st->codec->codec_tag);
716
                if (st->codec->codec_id == CODEC_ID_PROBE &&
716
                if (st->codec->codec_id == CODEC_ID_NONE &&
717 717
                    stream_type == STREAM_TYPE_PRIVATE_DATA)
718 718
                    mpegts_find_stream_type(st, st->codec->codec_tag, REGD_types);
719 719
                break;
......
955 955
                        code != 0x1ff && code != 0x1f2 && /* program_stream_directory, DSMCC_stream */
956 956
                        code != 0x1f8) {                  /* ITU-T Rec. H.222.1 type E stream */
957 957
                        pes->state = MPEGTS_PESHEADER;
958
                        if (pes->st->codec->codec_id == CODEC_ID_NONE) {
959
                            dprintf(pes->stream, "pid=%x stream_type=%x probing\n",
960
                                    pes->pid, pes->stream_type);
961
                            pes->st->codec->codec_id = CODEC_ID_PROBE;
962
                        }
958 963
                    } else {
959 964
                        pes->state = MPEGTS_PAYLOAD;
960 965
                        pes->data_index = 0;

Also available in: Unified diff