Revision 5d6e4c16 ffmpeg.c

View differences:

ffmpeg.c
148 148
static int frame_height = 0;
149 149
static float frame_aspect_ratio = 0;
150 150
static enum PixelFormat frame_pix_fmt = PIX_FMT_NONE;
151
static enum SampleFormat audio_sample_fmt = SAMPLE_FMT_NONE;
151
static enum AVSampleFormat audio_sample_fmt = AV_SAMPLE_FMT_NONE;
152 152
static int max_frames[4] = {INT_MAX, INT_MAX, INT_MAX, INT_MAX};
153 153
static AVRational frame_rate;
154 154
static float video_qscale = 0;
......
597 597
static void choose_sample_fmt(AVStream *st, AVCodec *codec)
598 598
{
599 599
    if(codec && codec->sample_fmts){
600
        const enum SampleFormat *p= codec->sample_fmts;
600
        const enum AVSampleFormat *p= codec->sample_fmts;
601 601
        for(; *p!=-1; p++){
602 602
            if(*p == st->codec->sample_fmt)
603 603
                break;
......
809 809
        ost->audio_resample = 1;
810 810

  
811 811
    if (ost->audio_resample && !ost->resample) {
812
        if (dec->sample_fmt != SAMPLE_FMT_S16)
812
        if (dec->sample_fmt != AV_SAMPLE_FMT_S16)
813 813
            fprintf(stderr, "Warning, using s16 intermediate sample format for resampling\n");
814 814
        ost->resample = av_audio_resample_init(enc->channels,    dec->channels,
815 815
                                               enc->sample_rate, dec->sample_rate,
......
823 823
        }
824 824
    }
825 825

  
826
#define MAKE_SFMT_PAIR(a,b) ((a)+SAMPLE_FMT_NB*(b))
826
#define MAKE_SFMT_PAIR(a,b) ((a)+AV_SAMPLE_FMT_NB*(b))
827 827
    if (!ost->audio_resample && dec->sample_fmt!=enc->sample_fmt &&
828 828
        MAKE_SFMT_PAIR(enc->sample_fmt,dec->sample_fmt)!=ost->reformat_pair) {
829 829
        if (ost->reformat_ctx)
......
2175 2175
                ost->fifo= av_fifo_alloc(1024);
2176 2176
                if(!ost->fifo)
2177 2177
                    goto fail;
2178
                ost->reformat_pair = MAKE_SFMT_PAIR(SAMPLE_FMT_NONE,SAMPLE_FMT_NONE);
2178
                ost->reformat_pair = MAKE_SFMT_PAIR(AV_SAMPLE_FMT_NONE,AV_SAMPLE_FMT_NONE);
2179 2179
                ost->audio_resample = codec->sample_rate != icodec->sample_rate || audio_sync_method > 1;
2180 2180
                icodec->request_channels = codec->channels;
2181 2181
                ist->decoding_needed = 1;
......
2851 2851
    if (strcmp(arg, "list"))
2852 2852
        audio_sample_fmt = av_get_sample_fmt(arg);
2853 2853
    else {
2854
        list_fmts(av_get_sample_fmt_string, SAMPLE_FMT_NB);
2854
        list_fmts(av_get_sample_fmt_string, AV_SAMPLE_FMT_NB);
2855 2855
        ffmpeg_exit(0);
2856 2856
    }
2857 2857
}

Also available in: Unified diff