Revision 01f4895c libavformat/nsvdec.c

View differences:

libavformat/nsvdec.c
439 439
            if (!nst)
440 440
                goto fail;
441 441
            st->priv_data = nst;
442
            st->codec.codec_type = CODEC_TYPE_VIDEO;
443
            st->codec.codec_tag = vtag;
444
            st->codec.codec_id = codec_get_id(nsv_codec_video_tags, vtag);
445
            st->codec.width = vwidth;
446
            st->codec.height = vheight;
447
            st->codec.bits_per_sample = 24; /* depth XXX */
442
            st->codec->codec_type = CODEC_TYPE_VIDEO;
443
            st->codec->codec_tag = vtag;
444
            st->codec->codec_id = codec_get_id(nsv_codec_video_tags, vtag);
445
            st->codec->width = vwidth;
446
            st->codec->height = vheight;
447
            st->codec->bits_per_sample = 24; /* depth XXX */
448 448

  
449 449
            av_set_pts_info(st, 64, framerate.den, framerate.num);
450 450
            st->start_time = 0;
......
460 460
            if (!nst)
461 461
                goto fail;
462 462
            st->priv_data = nst;
463
            st->codec.codec_type = CODEC_TYPE_AUDIO;
464
            st->codec.codec_tag = atag;
465
            st->codec.codec_id = codec_get_id(nsv_codec_audio_tags, atag);
463
            st->codec->codec_type = CODEC_TYPE_AUDIO;
464
            st->codec->codec_tag = atag;
465
            st->codec->codec_id = codec_get_id(nsv_codec_audio_tags, atag);
466 466
            st->start_time = 0;
467 467
//            st->duration = nsv->duration; //FIXME
468 468
            
469 469
            st->need_parsing = 1; /* for PCM we will read a chunk later and put correct info */
470 470
            /* XXX:FIXME */
471
            //st->codec.channels = 2; //XXX:channels;
472
            //st->codec.sample_rate = 1000;
473
            //av_set_pts_info(st, 64, 1, st->codec.sample_rate);
471
            //st->codec->channels = 2; //XXX:channels;
472
            //st->codec->sample_rate = 1000;
473
            //av_set_pts_info(st, 64, 1, st->codec->sample_rate);
474 474

  
475 475
#endif
476 476
        }
......
606 606
        pkt = &nsv->ahead[NSV_ST_AUDIO];
607 607
        /* read raw audio specific header on the first audio chunk... */
608 608
        /* on ALL audio chunks ?? seems so! */
609
        if (asize && st[NSV_ST_AUDIO]->codec.codec_tag == MKTAG('P', 'C', 'M', ' ')/* && fill_header*/) {
609
        if (asize && st[NSV_ST_AUDIO]->codec->codec_tag == MKTAG('P', 'C', 'M', ' ')/* && fill_header*/) {
610 610
            uint8_t bps;
611 611
            uint8_t channels;
612 612
            uint16_t samplerate;
......
622 622
                }
623 623
                bps /= channels; // ???
624 624
                if (bps == 8)
625
                    st[NSV_ST_AUDIO]->codec.codec_id = CODEC_ID_PCM_U8;
625
                    st[NSV_ST_AUDIO]->codec->codec_id = CODEC_ID_PCM_U8;
626 626
                samplerate /= 4;/* UGH ??? XXX */
627 627
                channels = 1;
628
                st[NSV_ST_AUDIO]->codec.channels = channels;
629
                st[NSV_ST_AUDIO]->codec.sample_rate = samplerate;
628
                st[NSV_ST_AUDIO]->codec->channels = channels;
629
                st[NSV_ST_AUDIO]->codec->sample_rate = samplerate;
630 630
                av_set_pts_info(st[NSV_ST_AUDIO], 64, 1, 
631
                                st[NSV_ST_AUDIO]->codec.sample_rate);
631
                                st[NSV_ST_AUDIO]->codec->sample_rate);
632 632
                PRINT(("NSV RAWAUDIO: bps %d, nchan %d, srate %ld\n", bps, channels, samplerate));
633 633
            }
634 634
        }
......
704 704
            av_free(ast->index_entries);
705 705
            av_free(ast);
706 706
        }
707
        av_free(st->codec.extradata);
708
        av_free(st->codec.palctrl);
707
        av_free(st->codec->extradata);
708
        av_free(st->codec->palctrl);
709 709
    }
710 710

  
711 711
#endif

Also available in: Unified diff