4 new revisions:
Revision: 4d0737948742
Author: Marc Noirot <
marc....@gmail.com>
Date: Wed Feb 20 07:39:27 2013
Log: Added a .travis.yml file.
http://code.google.com/p/flvmeta/source/detail?r=4d0737948742
Revision: 8ee8c0bff68f
Author: Marc Noirot <
marc....@gmail.com>
Date: Wed Feb 20 07:46:01 2013
Log: Fixed travis build.
http://code.google.com/p/flvmeta/source/detail?r=8ee8c0bff68f
Revision: 9000a2b8e1c0
Author: Marc Noirot <
marc....@gmail.com>
Date: Wed Feb 20 07:51:04 2013
Log: Completed Travis build, and added status icon.
http://code.google.com/p/flvmeta/source/detail?r=9000a2b8e1c0
Revision: 5ba4947fd52e
Author: Marc Noirot <
marc....@gmail.com>
Date: Sun Apr 21 15:07:25 2013
Log: Improved file duration detection by correctly tracking the last
media ...
http://code.google.com/p/flvmeta/source/detail?r=5ba4947fd52e
==============================================================================
Revision: 4d0737948742
Author: Marc Noirot <
marc....@gmail.com>
Date: Wed Feb 20 07:39:27 2013
Log: Added a .travis.yml file.
http://code.google.com/p/flvmeta/source/detail?r=4d0737948742
Added:
/.travis.yml
=======================================
--- /dev/null
+++ /.travis.yml Wed Feb 20 07:39:27 2013
@@ -0,0 +1,5 @@
+language: c
+script: cmake
+compiler:
+ - clang
+ - gcc
==============================================================================
Revision: 8ee8c0bff68f
Author: Marc Noirot <
marc....@gmail.com>
Date: Wed Feb 20 07:46:01 2013
Log: Fixed travis build.
http://code.google.com/p/flvmeta/source/detail?r=8ee8c0bff68f
Modified:
/.travis.yml
=======================================
--- /.travis.yml Wed Feb 20 07:39:27 2013
+++ /.travis.yml Wed Feb 20 07:46:01 2013
@@ -1,5 +1,5 @@
language: c
-script: cmake
+script: cmake .
compiler:
- clang
- gcc
==============================================================================
Revision: 9000a2b8e1c0
Author: Marc Noirot <
marc....@gmail.com>
Date: Wed Feb 20 07:51:04 2013
Log: Completed Travis build, and added status icon.
http://code.google.com/p/flvmeta/source/detail?r=9000a2b8e1c0
Modified:
/.travis.yml
/README.md
=======================================
--- /.travis.yml Wed Feb 20 07:46:01 2013
+++ /.travis.yml Wed Feb 20 07:51:04 2013
@@ -1,5 +1,5 @@
language: c
-script: cmake .
+script: cmake . && make
compiler:
- clang
- gcc
=======================================
--- /README.md Thu May 3 07:55:51 2012
+++ /README.md Wed Feb 20 07:51:04 2013
@@ -1,4 +1,4 @@
-# FLVmeta - FLV Metadata Editor
+# FLVmeta - FLV Metadata Editor [](https://travis-ci.org/noirotm/flvmeta)
flvmeta is a command-line utility aimed at manipulating Adobe(tm) Flash
Video files (FLV), through several commands, only one of which can be used
for
==============================================================================
Revision: 5ba4947fd52e
Author: Marc Noirot <
marc....@gmail.com>
Date: Sun Apr 21 15:07:25 2013
Log: Improved file duration detection by correctly tracking the last
media frame's type.
http://code.google.com/p/flvmeta/source/detail?r=5ba4947fd52e
Modified:
/src/info.c
/src/info.h
=======================================
--- /src/info.c Sat Jan 5 05:26:45 2013
+++ /src/info.c Sun Apr 21 15:07:25 2013
@@ -228,6 +228,7 @@
info->audio_frame_duration = 0;
info->total_prev_tags_size = 0;
info->have_on_last_second = 0;
+ info->last_media_frame_type = 0;
info->original_on_metadata = NULL;
info->keyframes = NULL;
info->times = NULL;
@@ -465,12 +466,13 @@
info->video_frames_number++;
/*
- we assume all video frames have the same size as the first
one:
- probably bogus but only used in case there's no audio in
the file
+ we assume all video frames have the same size as the first
one
*/
if (info->video_frame_duration == 0) {
info->video_frame_duration = timestamp -
info->video_first_timestamp;
}
+
+ info->last_media_frame_type = FLV_TAG_TYPE_VIDEO;
info->video_data_size += (body_length + FLV_TAG_SIZE);
info->total_prev_tags_size += sizeof(uint32_be);
@@ -505,6 +507,8 @@
info->real_audio_data_size += (body_length - 1);
}
+ info->last_media_frame_type = FLV_TAG_TYPE_AUDIO;
+
info->audio_data_size += (body_length + FLV_TAG_SIZE);
info->total_prev_tags_size += sizeof(uint32_be);
}
@@ -564,12 +568,17 @@
amf_associative_array_add(meta->on_metadata, "hasVideo",
amf_boolean_new(info->have_video));
amf_associative_array_add(meta->on_metadata, "hasAudio",
amf_boolean_new(info->have_audio));
- if (info->have_audio) {
+ if (info->last_media_frame_type == FLV_TAG_TYPE_AUDIO) {
duration = (info->last_timestamp - (opts->reset_timestamps ? 0 :
info->first_timestamp) + info->audio_frame_duration) / 1000.0;
}
+ else if (info->last_media_frame_type == FLV_TAG_TYPE_VIDEO) {
+ duration = (info->last_timestamp - (opts->reset_timestamps ? 0 :
info->first_timestamp) + info->video_frame_duration) / 1000.0;
+ }
else {
- duration = (info->last_timestamp - (opts->reset_timestamps ? 0 :
info->first_timestamp) + info->video_frame_duration) / 1000.0;
+ /* no last frame type means no audio and no video, therefore no
duration */
+ duration = 0;
}
+
amf_associative_array_add(meta->on_metadata, "duration",
amf_number_new(duration));
amf_associative_array_add(meta->on_metadata, "lasttimestamp",
amf_number_new(info->last_timestamp / 1000.0));
=======================================
--- /src/info.h Sat Jan 5 05:26:45 2013
+++ /src/info.h Sun Apr 21 15:07:25 2013
@@ -55,6 +55,7 @@
uint32 audio_frame_duration;
file_offset_t total_prev_tags_size;
uint8 have_on_last_second;
+ uint8 last_media_frame_type;
amf_data * original_on_metadata;
amf_data * keyframes;
amf_data * times;