[FFmpeg-cvslog] lavf: move has_decode_delay_been_guessed() up to make it accessible to earlier functions

Michael Niedermayer git at videolan.org
Sat Aug 4 15:50:45 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Aug  4 15:35:53 2012 +0200| [c91ca5b95d0ede47a5142f98e710a9bf83ba8242] | committer: Michael Niedermayer

lavf: move has_decode_delay_been_guessed() up to make it accessible to earlier functions

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c91ca5b95d0ede47a5142f98e710a9bf83ba8242
---

 libavformat/utils.c |   32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 3807954..86e5408 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)
 {



More information about the ffmpeg-cvslog mailing list