summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-08-04 15:35:53 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-08-04 15:42:44 +0200
commitc91ca5b95d0ede47a5142f98e710a9bf83ba8242 (patch)
treee728dd7aec4f7f4ca2b1cb503d14a03f0fe66a0d /libavformat/utils.c
parentae0312ab2e7545195078c734b081c4f1c8933490 (diff)
lavf: move has_decode_delay_been_guessed() up to make it accessible to earlier functions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 3807954e21..86e5408c42 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -901,6 +901,22 @@ static int is_intra_only(AVCodecContext *enc){
return 0;
}
+static int has_decode_delay_been_guessed(AVStream *st)
+{
+ if(st->codec->codec_id != CODEC_ID_H264) return 1;
+#if CONFIG_H264_DECODER
+ if(st->codec->has_b_frames &&
+ avpriv_h264_has_num_reorder_frames(st->codec) == st->codec->has_b_frames)
+ return 1;
+#endif
+ if(st->codec->has_b_frames<3)
+ return st->info->nb_decoded_frames >= 6;
+ else if(st->codec->has_b_frames<4)
+ return st->info->nb_decoded_frames >= 18;
+ else
+ return st->info->nb_decoded_frames >= 20;
+}
+
static AVPacketList *get_next_pkt(AVFormatContext *s, AVStream *st, AVPacketList *pktl)
{
if (pktl->next)
@@ -2313,22 +2329,6 @@ static int has_codec_parameters(AVStream *st, const char **errmsg_ptr)
return 1;
}
-static int has_decode_delay_been_guessed(AVStream *st)
-{
- if(st->codec->codec_id != CODEC_ID_H264) return 1;
-#if CONFIG_H264_DECODER
- if(st->codec->has_b_frames &&
- avpriv_h264_has_num_reorder_frames(st->codec) == st->codec->has_b_frames)
- return 1;
-#endif
- if(st->codec->has_b_frames<3)
- return st->info->nb_decoded_frames >= 6;
- else if(st->codec->has_b_frames<4)
- return st->info->nb_decoded_frames >= 18;
- else
- return st->info->nb_decoded_frames >= 20;
-}
-
/* returns 1 or 0 if or if not decoded data was returned, or a negative error */
static int try_decode_frame(AVStream *st, AVPacket *avpkt, AVDictionary **options)
{