return NULL;
}
} else {
- av_set_pts_info(st, 32, 1, 90000);
switch(st->codec->codec_id) {
case CODEC_ID_MPEG1VIDEO:
case CODEC_ID_MPEG2VIDEO:
st->need_parsing = AVSTREAM_PARSE_FULL;
break;
case CODEC_ID_ADPCM_G722:
- av_set_pts_info(st, 32, 1, st->codec->sample_rate);
/* According to RFC 3551, the stream clock rate is 8000
* even if the sample rate is 16000. */
if (st->codec->sample_rate == 8000)
st->codec->sample_rate = 16000;
break;
default:
- if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
- av_set_pts_info(st, 32, 1, st->codec->sample_rate);
- }
break;
}
}
/* parse the rtpmap description: <codec_name>/<clock_rate>[/<other params>] */
static int sdp_parse_rtpmap(AVFormatContext *s,
- AVCodecContext *codec, RTSPStream *rtsp_st,
+ AVStream *st, RTSPStream *rtsp_st,
int payload_type, const char *p)
{
+ AVCodecContext *codec = st->codec;
char buf[256];
int i;
AVCodec *c;
codec->channels = RTSP_DEFAULT_NB_AUDIO_CHANNELS;
if (i > 0) {
codec->sample_rate = i;
+ av_set_pts_info(st, 32, 1, codec->sample_rate);
get_word_sep(buf, sizeof(buf), "/", &p);
i = atoi(buf);
if (i > 0)
break;
case AVMEDIA_TYPE_VIDEO:
av_log(s, AV_LOG_DEBUG, "video codec set to: %s\n", c_name);
+ if (i > 0)
+ av_set_pts_info(st, 32, 1, i);
break;
default:
break;
RTPDynamicProtocolHandler *handler;
/* if standard payload type, we can find the codec right now */
ff_rtp_get_codec_info(st->codec, rtsp_st->sdp_payload_type);
+ if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO)
+ av_set_pts_info(st, 32, 1, st->codec->sample_rate);
/* Even static payload types may need a custom depacketizer */
handler = ff_rtp_handler_find_by_id(
rtsp_st->sdp_payload_type, st->codec->codec_type);
payload_type = atoi(buf1);
st = s->streams[s->nb_streams - 1];
rtsp_st = st->priv_data;
- sdp_parse_rtpmap(s, st->codec, rtsp_st, payload_type, p);
+ sdp_parse_rtpmap(s, st, rtsp_st, payload_type, p);
} else if (av_strstart(p, "fmtp:", &p) ||
av_strstart(p, "framesize:", &p)) {
/* NOTE: fmtp is only supported AFTER the 'a=rtpmap:xxx' tag */