Revision 01f4895c libavformat/mpegtsenc.c

View differences:

libavformat/mpegtsenc.c
262 262
    for(i = 0; i < s->nb_streams; i++) {
263 263
        AVStream *st = s->streams[i];
264 264
        MpegTSWriteStream *ts_st = st->priv_data;
265
        switch(st->codec.codec_id) {
265
        switch(st->codec->codec_id) {
266 266
        case CODEC_ID_MPEG1VIDEO:
267 267
        case CODEC_ID_MPEG2VIDEO:
268 268
            stream_type = STREAM_TYPE_VIDEO_MPEG2;
......
293 293
        q += 2; /* patched after */
294 294

  
295 295
        /* write optional descriptors here */
296
        switch(st->codec.codec_type) {
296
        switch(st->codec->codec_type) {
297 297
        case CODEC_TYPE_AUDIO:
298 298
            if (strlen(st->language) == 3) {
299 299
                *q++ = 0x0a; /* ISO 639 language descriptor */
......
452 452
        ts_st->pid = DEFAULT_START_PID + i;
453 453
        ts_st->payload_pts = AV_NOPTS_VALUE;
454 454
        /* update PCR pid by using the first video stream */
455
        if (st->codec.codec_type == CODEC_TYPE_VIDEO && 
455
        if (st->codec->codec_type == CODEC_TYPE_VIDEO && 
456 456
            service->pcr_pid == 0x1fff)
457 457
            service->pcr_pid = ts_st->pid;
458
        total_bit_rate += st->codec.bit_rate;
458
        total_bit_rate += st->codec->bit_rate;
459 459
    }
460 460
    
461 461
    /* if no video stream, use the first stream as PCR */
......
570 570
            *q++ = 0x00;
571 571
            *q++ = 0x01;
572 572
            private_code = 0;
573
            if (st->codec.codec_type == CODEC_TYPE_VIDEO) {
573
            if (st->codec->codec_type == CODEC_TYPE_VIDEO) {
574 574
                *q++ = 0xe0;
575
            } else if (st->codec.codec_type == CODEC_TYPE_AUDIO &&
576
                       (st->codec.codec_id == CODEC_ID_MP2 ||
577
                        st->codec.codec_id == CODEC_ID_MP3)) {
575
            } else if (st->codec->codec_type == CODEC_TYPE_AUDIO &&
576
                       (st->codec->codec_id == CODEC_ID_MP2 ||
577
                        st->codec->codec_id == CODEC_ID_MP3)) {
578 578
                *q++ = 0xc0; 
579 579
            } else {
580 580
                *q++ = 0xbd;
581
                if (st->codec.codec_type == CODEC_TYPE_SUBTITLE) {
581
                if (st->codec->codec_type == CODEC_TYPE_SUBTITLE) {
582 582
                    private_code = 0x20;
583 583
                }
584 584
            }
......
593 593
            *q++ = len;
594 594
            val = 0x80;
595 595
            /* data alignment indicator is required for subtitle data */
596
            if (st->codec.codec_type == CODEC_TYPE_SUBTITLE)
596
            if (st->codec->codec_type == CODEC_TYPE_SUBTITLE)
597 597
                val |= 0x04;
598 598
            *q++ = val;
599 599
            if (pts != AV_NOPTS_VALUE) {
......
660 660
    MpegTSWriteStream *ts_st = st->priv_data;
661 661
    int len, max_payload_size;
662 662

  
663
    if (st->codec.codec_type == CODEC_TYPE_SUBTITLE) {
663
    if (st->codec->codec_type == CODEC_TYPE_SUBTITLE) {
664 664
        /* for subtitle, a single PES packet must be generated */
665 665
        mpegts_write_pes(s, st, buf, size, pkt->pts);
666 666
        return 0;

Also available in: Unified diff