]> git.sesse.net Git - ffmpeg/blobdiff - tests/seek_test.c
More accurate rounding for 8bit inputs.
[ffmpeg] / tests / seek_test.c
index 025268549fd198e190bb0ea99c21efefc25e8d31..088bbc8302254ffca381ad9e9129e5e577932c4b 100644 (file)
  * License along with FFmpeg; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
+
+#include <stdint.h>
 #include <stdlib.h>
 #include <stdio.h>
 
-#include "avformat.h"
+#include "libavformat/avformat.h"
 
 #undef exit
 
@@ -31,6 +33,10 @@ int main(int argc, char **argv)
     AVFormatContext *ic;
     int i, ret, stream_id;
     int64_t timestamp;
+    AVFormatParameters params, *ap= &params;
+    memset(ap, 0, sizeof(params));
+    ap->channels=1;
+    ap->sample_rate= 22050;
 
     /* initialize libavcodec, and register all codecs and formats */
     av_register_all();
@@ -50,7 +56,7 @@ int main(int argc, char **argv)
         exit(1);
     }
 
-    ret = av_open_input_file(&ic, filename, NULL, 0, NULL);
+    ret = av_open_input_file(&ic, filename, NULL, 0, ap);
     if (ret < 0) {
         fprintf(stderr, "cannot open %s\n", filename);
         exit(1);
@@ -72,7 +78,7 @@ int main(int argc, char **argv)
             printf("ret:%2d", ret);
             if(ret>=0){
                 st= ic->streams[pkt.stream_index];
-                printf(" st:%2d dts:%f pts:%f pos:%Ld size:%d flags:%d", pkt.stream_index, pkt.dts*av_q2d(st->time_base), pkt.pts*av_q2d(st->time_base), pkt.pos, pkt.size, pkt.flags);
+                printf(" st:%2d dts:%f pts:%f pos:%" PRId64 " size:%d flags:%d", pkt.stream_index, pkt.dts*av_q2d(st->time_base), pkt.pts*av_q2d(st->time_base), pkt.pos, pkt.size, pkt.flags);
             }
             printf("\n");
         }