Mercurial > libavformat.hg
comparison ffmdec.c @ 3350:e092bf9b744f libavformat
move get_pts function to avoid useless declaration
author | bcoudurier |
---|---|
date | Mon, 26 May 2008 03:47:07 +0000 |
parents | 4d492fccf79b |
children | 6063f3cf59e6 |
comparison
equal
deleted
inserted
replaced
3349:54e578571711 | 3350:e092bf9b744f |
---|---|
20 */ | 20 */ |
21 | 21 |
22 #include "avformat.h" | 22 #include "avformat.h" |
23 #include "ffm.h" | 23 #include "ffm.h" |
24 #include <unistd.h> | 24 #include <unistd.h> |
25 | |
26 static int64_t get_pts(AVFormatContext *s, offset_t pos); | |
27 | 25 |
28 static int ffm_is_avail_data(AVFormatContext *s, int size) | 26 static int ffm_is_avail_data(AVFormatContext *s, int size) |
29 { | 27 { |
30 FFMContext *ffm = s->priv_data; | 28 FFMContext *ffm = s->priv_data; |
31 offset_t pos, avail_size; | 29 offset_t pos, avail_size; |
107 first = 0; | 105 first = 0; |
108 } | 106 } |
109 return size1 - size; | 107 return size1 - size; |
110 } | 108 } |
111 | 109 |
110 static int64_t get_pts(AVFormatContext *s, offset_t pos) | |
111 { | |
112 ByteIOContext *pb = s->pb; | |
113 int64_t pts; | |
114 | |
115 ffm_seek1(s, pos); | |
116 url_fskip(pb, 4); | |
117 pts = get_be64(pb); | |
118 #ifdef DEBUG_SEEK | |
119 printf("pts=%0.6f\n", pts / 1000000.0); | |
120 #endif | |
121 return pts; | |
122 } | |
112 | 123 |
113 static void adjust_write_index(AVFormatContext *s) | 124 static void adjust_write_index(AVFormatContext *s) |
114 { | 125 { |
115 FFMContext *ffm = s->priv_data; | 126 FFMContext *ffm = s->priv_data; |
116 ByteIOContext *pb = s->pb; | 127 ByteIOContext *pb = s->pb; |
374 printf("seek to %"PRIx64" -> %"PRIx64"\n", pos1, pos); | 385 printf("seek to %"PRIx64" -> %"PRIx64"\n", pos1, pos); |
375 #endif | 386 #endif |
376 url_fseek(pb, pos, SEEK_SET); | 387 url_fseek(pb, pos, SEEK_SET); |
377 } | 388 } |
378 | 389 |
379 static int64_t get_pts(AVFormatContext *s, offset_t pos) | |
380 { | |
381 ByteIOContext *pb = s->pb; | |
382 int64_t pts; | |
383 | |
384 ffm_seek1(s, pos); | |
385 url_fskip(pb, 4); | |
386 pts = get_be64(pb); | |
387 #ifdef DEBUG_SEEK | |
388 printf("pts=%0.6f\n", pts / 1000000.0); | |
389 #endif | |
390 return pts; | |
391 } | |
392 | |
393 /* seek to a given time in the file. The file read pointer is | 390 /* seek to a given time in the file. The file read pointer is |
394 positioned at or before pts. XXX: the following code is quite | 391 positioned at or before pts. XXX: the following code is quite |
395 approximative */ | 392 approximative */ |
396 static int ffm_seek(AVFormatContext *s, int stream_index, int64_t wanted_pts, int flags) | 393 static int ffm_seek(AVFormatContext *s, int stream_index, int64_t wanted_pts, int flags) |
397 { | 394 { |