diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2007-03-01 17:05:11 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2007-03-01 17:05:11 +0000 |
commit | 024c7378c38127b51f3146e2e33fda76c3dae9c7 (patch) | |
tree | 4fd3cb2ba1efb425962a407040c0865253ef98e4 | |
parent | dfc1313d28c58e71e24728bca274bfd85151aef2 (diff) | |
download | ffmpeg-024c7378c38127b51f3146e2e33fda76c3dae9c7.tar.gz |
factorize
Originally committed as revision 8175 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/swf.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/libavformat/swf.c b/libavformat/swf.c index 3080259ef8..fc5d657147 100644 --- a/libavformat/swf.c +++ b/libavformat/swf.c @@ -786,13 +786,8 @@ static int swf_read_header(AVFormatContext *s, AVFormatParameters *ap) get_byte(pb); /* Check for FLV1 */ vst = av_new_stream(s, ch_id); - av_set_pts_info(vst, 24, 1, 1000); /* 24 bit pts in ms */ vst->codec->codec_type = CODEC_TYPE_VIDEO; vst->codec->codec_id = codec_get_id(swf_codec_tags, get_byte(pb)); - if (swf->ms_per_frame) { - vst->codec->time_base.den = 1000. / swf->ms_per_frame; - vst->codec->time_base.num = 1; - } } else if ( ( tag == TAG_STREAMHEAD || tag == TAG_STREAMHEAD2 ) && !ast) { /* streaming found */ int sample_rate_code; @@ -816,18 +811,20 @@ static int swf_read_header(AVFormatContext *s, AVFormatParameters *ap) } else if (tag == TAG_JPEG2 && !vst) { vst = av_new_stream(s, -2); /* -2 to avoid clash with video stream and audio stream */ - av_set_pts_info(vst, 24, 1, 1000); /* 24 bit pts in ms */ vst->codec->codec_type = CODEC_TYPE_VIDEO; vst->codec->codec_id = CODEC_ID_MJPEG; - if (swf->ms_per_frame) { - vst->codec->time_base.den = 1000. / swf->ms_per_frame; - vst->codec->time_base.num = 1; - } url_fskip(pb, len); } else { url_fskip(pb, len); } } + if (vst) { + av_set_pts_info(vst, 24, 1, 1000); /* 24 bit pts in ms */ + if (swf->ms_per_frame) { + vst->codec->time_base.den = 1000. / swf->ms_per_frame; + vst->codec->time_base.num = 1; + } + } url_fseek(pb, firstTagOff, SEEK_SET); return 0; |