*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
#define FLIC_FILE_MAGIC_1 0xAF11
#define FLIC_FILE_MAGIC_2 0xAF12
+#define FLIC_FILE_MAGIC_3 0xAF44 /* Flic Type for Extended FLX Format which
+ originated in Dave's Targa Animator (DTA) */
#define FLIC_CHUNK_MAGIC_1 0xF1FA
#define FLIC_CHUNK_MAGIC_2 0xF5FA
#define FLIC_MC_PTS_INC 6000 /* pts increment for Magic Carpet game FLIs */
magic_number = LE_16(&p->buf[4]);
if ((magic_number != FLIC_FILE_MAGIC_1) &&
- (magic_number != FLIC_FILE_MAGIC_2))
+ (magic_number != FLIC_FILE_MAGIC_2) &&
+ (magic_number != FLIC_FILE_MAGIC_3))
return 0;
return AVPROBE_SCORE_MAX;
* therefore, the frame pts increment = n * 1285.7
*/
flic->frame_pts_inc = speed * 1285.7;
- } else if (magic_number == FLIC_FILE_MAGIC_2) {
+ } else if ((magic_number == FLIC_FILE_MAGIC_2) ||
+ (magic_number == FLIC_FILE_MAGIC_3)) {
/*
* in this case, the speed (n) is number of milliseconds between frames:
*
}
pkt->stream_index = flic->video_stream_index;
pkt->pts = flic->pts;
- pkt->pos = url_ftell(pb);
+ pkt->pos = url_ftell(pb);
memcpy(pkt->data, preamble, FLIC_PREAMBLE_SIZE);
- ret = get_buffer(pb, pkt->data + FLIC_PREAMBLE_SIZE,
+ ret = get_buffer(pb, pkt->data + FLIC_PREAMBLE_SIZE,
size - FLIC_PREAMBLE_SIZE);
if (ret != size - FLIC_PREAMBLE_SIZE) {
av_free_packet(pkt);
return 0;
}
-static AVInputFormat flic_iformat = {
+AVInputFormat flic_demuxer = {
"flic",
- "FLI/FLC animation format",
+ "FLI/FLC/FLX animation format",
sizeof(FlicDemuxContext),
flic_probe,
flic_read_header,
flic_read_packet,
flic_read_close,
};
-
-int flic_init(void)
-{
- av_register_input_format(&flic_iformat);
- return 0;
-}