summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 03856bd)
raw | patch | inline | side by side (parent: 03856bd)
author | Vincent Stehlé <v-stehle@ti.com> | |
Tue, 21 Aug 2012 16:35:55 +0000 (18:35 +0200) | ||
committer | Vincent Stehlé <v-stehle@ti.com> | |
Tue, 21 Aug 2012 16:35:58 +0000 (18:35 +0200) |
New demux_rewind() function, to seek to frame 0 of a stream and allow playback
in a loop.
Signed-off-by: Vincent Stehlé <v-stehle@ti.com>
in a loop.
Signed-off-by: Vincent Stehlé <v-stehle@ti.com>
util/demux.c | patch | blob | history | |
util/demux.h | patch | blob | history |
diff --git a/util/demux.c b/util/demux.c
index 7b5b944432929335fe260a5b450fcc94a3eebfc0..4e36f1a41d66c8309e38fbc819c86b8325c8af6e 100644 (file)
--- a/util/demux.c
+++ b/util/demux.c
return 0;
}
+int demux_rewind(struct demux *demux)
+{
+ return av_seek_frame(demux->afc, demux->st->index, 0, AVSEEK_FLAG_FRAME);
+}
+
void demux_deinit(struct demux *demux)
{
av_close_input_file(demux->afc);
diff --git a/util/demux.h b/util/demux.h
index 058997d4468fe4e8117dc0c3ace4d1eb7facdc2b..56538494ec009816837435dccd515c8c5db257bc 100644 (file)
--- a/util/demux.h
+++ b/util/demux.h
struct demux * demux_init(const char * filename, int *width, int *height);
int demux_read(struct demux *demux, char *input, int size);
+int demux_rewind(struct demux *demux);
void demux_deinit(struct demux *demux);
#endif /* __DEMUX_H__ */