aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-05-20 10:28:41 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-05-20 11:35:08 +0200
commit3cf5591344473263816a756d678572ecfb28045c (patch)
tree30c5132b4b4882cd3e9409c4dbf9d7d991eff158 /ffmpeg.c
parent8364cb97193829dc3e14484c0aaadf59c0cafc8c (diff)
downloadandroid_external_ffmpeg-3cf5591344473263816a756d678572ecfb28045c.tar.gz
android_external_ffmpeg-3cf5591344473263816a756d678572ecfb28045c.tar.bz2
android_external_ffmpeg-3cf5591344473263816a756d678572ecfb28045c.zip
ffmpeg: reintroducing check_recording_time()
This reduces the difference to qatar by 27 lines No functional change, the code should be unused Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 6848f252e4..7eef3d4af5 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -276,6 +276,9 @@ typedef struct OutputStream {
for A/V sync */
struct InputStream *sync_ist; /* input stream to sync against */
int64_t sync_opts; /* output frame counter, could be changed to some true timestamp */ // FIXME look at frame_number
+ /* pts of the first frame encoded for this stream, used for limiting
+ * recording time */
+ int64_t first_pts;
AVBitStreamFilterContext *bitstream_filters;
AVCodec *enc;
int64_t max_frames;
@@ -1744,18 +1747,18 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
}
}
-// static int check_recording_time(OutputStream *ost)
-// {
-// OutputFile *of = output_files[ost->file_index];
-//
-// if (of->recording_time != INT64_MAX &&
-// av_compare_ts(ost->sync_opts - ost->first_pts, ost->st->codec->time_base, of->recording_time,
-// AV_TIME_BASE_Q) >= 0) {
-// ost->is_past_recording_time = 1;
-// return 0;
-// }
-// return 1;
-// }
+static int check_recording_time(OutputStream *ost)
+{
+ OutputFile *of = output_files[ost->file_index];
+
+ if (of->recording_time != INT64_MAX &&
+ av_compare_ts(ost->sync_opts - ost->first_pts, ost->st->codec->time_base, of->recording_time,
+ AV_TIME_BASE_Q) >= 0) {
+ ost->is_past_recording_time = 1;
+ return 0;
+ }
+ return 1;
+}
static void do_audio_out(AVFormatContext *s, OutputStream *ost,
AVFrame *frame)