Revision 01f4895c libavformat/flvdec.c

View differences:

libavformat/flvdec.c
102 102
            return AVERROR_NOMEM;
103 103

  
104 104
        av_set_pts_info(st, 24, 1, 1000); /* 24 bit pts in ms */
105
        st->codec.time_base= (AVRational){1,1000};
105
        st->codec->time_base= (AVRational){1,1000};
106 106
    }
107 107
//    av_log(NULL, AV_LOG_DEBUG, "%d %X %d \n", is_audio, flags, st->discard);
108 108
    if(  (st->discard >= AVDISCARD_NONKEY && !((flags >> 4)==1 ||  is_audio))
......
116 116
 }
117 117

  
118 118
    if(is_audio){
119
        if(st->codec.sample_rate == 0){
120
            st->codec.codec_type = CODEC_TYPE_AUDIO;
121
            st->codec.channels = (flags&1)+1;
119
        if(st->codec->sample_rate == 0){
120
            st->codec->codec_type = CODEC_TYPE_AUDIO;
121
            st->codec->channels = (flags&1)+1;
122 122
            if((flags >> 4) == 5)
123
                st->codec.sample_rate= 8000;
123
                st->codec->sample_rate= 8000;
124 124
            else
125
                st->codec.sample_rate = (44100<<((flags>>2)&3))>>3;
125
                st->codec->sample_rate = (44100<<((flags>>2)&3))>>3;
126 126
            switch(flags >> 4){/* 0: uncompressed 1: ADPCM 2: mp3 5: Nellymoser 8kHz mono 6: Nellymoser*/
127
	    case 0: if (flags&2) st->codec.codec_id = CODEC_ID_PCM_S16BE;
128
		    else st->codec.codec_id = CODEC_ID_PCM_S8; break;
129
	    case 1: st->codec.codec_id = CODEC_ID_ADPCM_SWF; break;
130
            case 2: st->codec.codec_id = CODEC_ID_MP3; break;
127
	    case 0: if (flags&2) st->codec->codec_id = CODEC_ID_PCM_S16BE;
128
		    else st->codec->codec_id = CODEC_ID_PCM_S8; break;
129
	    case 1: st->codec->codec_id = CODEC_ID_ADPCM_SWF; break;
130
            case 2: st->codec->codec_id = CODEC_ID_MP3; break;
131 131
	    // this is not listed at FLV but at SWF, strange...
132
	    case 3: if (flags&2) st->codec.codec_id = CODEC_ID_PCM_S16LE;
133
		    else st->codec.codec_id = CODEC_ID_PCM_S8; break;
132
	    case 3: if (flags&2) st->codec->codec_id = CODEC_ID_PCM_S16LE;
133
		    else st->codec->codec_id = CODEC_ID_PCM_S8; break;
134 134
            default:
135 135
    		av_log(s, AV_LOG_INFO, "Unsupported audio codec (%x)\n", flags >> 4);
136
                st->codec.codec_tag= (flags >> 4);
136
                st->codec->codec_tag= (flags >> 4);
137 137
            }
138
	    st->codec.bits_per_sample = (flags & 2) ? 16 : 8;
138
	    st->codec->bits_per_sample = (flags & 2) ? 16 : 8;
139 139
        }
140 140
    }else{
141
            st->codec.codec_type = CODEC_TYPE_VIDEO;
141
            st->codec->codec_type = CODEC_TYPE_VIDEO;
142 142
            switch(flags & 0xF){
143
            case 2: st->codec.codec_id = CODEC_ID_FLV1; break;
143
            case 2: st->codec->codec_id = CODEC_ID_FLV1; break;
144 144
            default:
145 145
    		av_log(s, AV_LOG_INFO, "Unsupported video codec (%x)\n", flags & 0xf);
146
                st->codec.codec_tag= flags & 0xF;
146
                st->codec->codec_tag= flags & 0xF;
147 147
            }
148 148
    }
149 149

  

Also available in: Unified diff