diff options
author | Martin Storsjö <martin@martin.st> | 2010-12-07 13:29:44 +0000 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2010-12-07 13:29:44 +0000 |
commit | 86b6e387cc16f873d2739af14f63696b648e0423 (patch) | |
tree | c4abe3caeeda5c55d800a00093f0afc5222476c4 /libavformat/rtpdec.c | |
parent | bb776f3b0037b4ddc2977643fb0efaeff756babc (diff) | |
download | ffmpeg-86b6e387cc16f873d2739af14f63696b648e0423.tar.gz |
rtsp/rtpdec: Set the AVStream time_base directly in rtsp when it is known
This fixes cases where the RTP time base and the sample rate of the stream
differ. Previously, the AVStream time_base was unconditionally set to
the sample rate (which initially was set to one value when parsing the
rtpmap field in the SDP, but later overridden by an a=SampleRate field).
Additionally, this makes the code actually use the stream time base set
in rtpmap for video codecs, instead of hardcoding it to always be 90 kHz.
Originally committed as revision 25908 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtpdec.c')
-rw-r--r-- | libavformat/rtpdec.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c index b7bdc0bb4d..77b59a3ff3 100644 --- a/libavformat/rtpdec.c +++ b/libavformat/rtpdec.c @@ -393,7 +393,6 @@ RTPDemuxContext *rtp_parse_open(AVFormatContext *s1, AVStream *st, URLContext *r return NULL; } } else { - av_set_pts_info(st, 32, 1, 90000); switch(st->codec->codec_id) { case CODEC_ID_MPEG1VIDEO: case CODEC_ID_MPEG2VIDEO: @@ -405,16 +404,12 @@ RTPDemuxContext *rtp_parse_open(AVFormatContext *s1, AVStream *st, URLContext *r 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; } } |