Browse code

rtsp: Don't set the RTP time base from the sample rate if no sample rate is set

This also reverts SVN rev 26016, which incorrectly overwrote the time base
with 90 kHz for all streams, regardless of what was set by the SDP parsing.

The stream that triggered the fix in 26016 still works after this commit.

Originally committed as revision 26022 to svn://svn.ffmpeg.org/ffmpeg/trunk

Martin Storsjö authored on 2010/12/16 06:06:25
Showing 2 changed files
... ...
@@ -393,7 +393,6 @@ RTPDemuxContext *rtp_parse_open(AVFormatContext *s1, AVStream *st, URLContext *r
393 393
             return NULL;
394 394
         }
395 395
     } else {
396
-        av_set_pts_info(st, 32, 1, 90000);
397 396
         switch(st->codec->codec_id) {
398 397
         case CODEC_ID_MPEG1VIDEO:
399 398
         case CODEC_ID_MPEG2VIDEO:
... ...
@@ -333,7 +333,8 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1,
333 333
                 RTPDynamicProtocolHandler *handler;
334 334
                 /* if standard payload type, we can find the codec right now */
335 335
                 ff_rtp_get_codec_info(st->codec, rtsp_st->sdp_payload_type);
336
-                if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO)
336
+                if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO &&
337
+                    st->codec->sample_rate > 0)
337 338
                     av_set_pts_info(st, 32, 1, st->codec->sample_rate);
338 339
                 /* Even static payload types may need a custom depacketizer */
339 340
                 handler = ff_rtp_handler_find_by_id(