]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/seek.c
flvdec: Add param change side data if the sample rate or channels have changed
[ffmpeg] / libavformat / seek.c
index a2e09a2fd4cbd2cc8ae2b987c4a82bb6f03c37b2..6c4286bb8e6727ea812fb5d6c14204b57a7790f8 100644 (file)
@@ -3,24 +3,25 @@
  *
  * Copyright (c) 2009 Ivan Schreter
  *
- * This file is part of FFmpeg.
+ * This file is part of Libav.
  *
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "seek.h"
+#include "libavutil/mathematics.h"
 #include "libavutil/mem.h"
 #include "internal.h"
 
@@ -162,7 +163,7 @@ static void search_hi_lo_keyframes(AVFormatContext *s,
 
         // Evaluate key frames with known TS (or any frames, if AVSEEK_FLAG_ANY set).
         if (pts != AV_NOPTS_VALUE &&
-            ((flg & PKT_FLAG_KEY) || (flags & AVSEEK_FLAG_ANY))) {
+            ((flg & AV_PKT_FLAG_KEY) || (flags & AVSEEK_FLAG_ANY))) {
             if (flags & AVSEEK_FLAG_BYTE) {
                 // for byte seeking, use position as timestamp
                 ts        = pos;
@@ -237,7 +238,7 @@ static void search_hi_lo_keyframes(AVFormatContext *s,
     }
 
     // Clean up the parser.
-    av_read_frame_flush(s);
+    ff_read_frame_flush(s);
 }
 
 int64_t ff_gen_syncpoint_search(AVFormatContext *s,
@@ -313,7 +314,7 @@ int64_t ff_gen_syncpoint_search(AVFormatContext *s,
     step = s->pb->buffer_size;
     curpos = FFMAX(pos - step / 2, 0);
     for (;;) {
-        url_fseek(s->pb, curpos, SEEK_SET);
+        avio_seek(s->pb, curpos, SEEK_SET);
         search_hi_lo_keyframes(s,
                                ts, time_base,
                                flags,
@@ -385,7 +386,7 @@ int64_t ff_gen_syncpoint_search(AVFormatContext *s,
         }
     }
 
-    url_fseek(s->pb, pos, SEEK_SET);
+    avio_seek(s->pb, pos, SEEK_SET);
     av_free(sync);
     return pos;
 }
@@ -405,7 +406,7 @@ AVParserState *ff_store_parser_state(AVFormatContext *s)
         return NULL;
     }
 
-    state->fpos = url_ftell(s->pb);
+    state->fpos = avio_tell(s->pb);
 
     // copy context structures
     state->cur_st                           = s->cur_st;
@@ -451,12 +452,12 @@ void ff_restore_parser_state(AVFormatContext *s, AVParserState *state)
     int i;
     AVStream *st;
     AVParserStreamState *ss;
-    av_read_frame_flush(s);
+    ff_read_frame_flush(s);
 
     if (!state)
         return;
 
-    url_fseek(s->pb, state->fpos, SEEK_SET);
+    avio_seek(s->pb, state->fpos, SEEK_SET);
 
     // copy context structures
     s->cur_st                           = state->cur_st;