Change ticker_tick to use ticker_abs as we want the absolute number
authorPhilip Gladstone <philipjsg@users.sourceforge.net>
Mon, 17 Jun 2002 03:10:37 +0000 (03:10 +0000)
committerPhilip Gladstone <philipjsg@users.sourceforge.net>
Mon, 17 Jun 2002 03:10:37 +0000 (03:10 +0000)
of ticks. In particular we want an INT64 return.

Originally committed as revision 693 to svn://svn.ffmpeg.org/ffmpeg/trunk

ffmpeg.c
libav/asf.c

index 3e73483..7375b62 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1055,7 +1055,7 @@ static int av_encode(AVFormatContext **output_files,
             switch(ist->st->codec.codec_type) {
             case CODEC_TYPE_AUDIO:
                 //ist->pts = (INT64)1000000 * ist->sample_index / ist->st->codec.sample_rate;
             switch(ist->st->codec.codec_type) {
             case CODEC_TYPE_AUDIO:
                 //ist->pts = (INT64)1000000 * ist->sample_index / ist->st->codec.sample_rate;
-                ist->pts = ticker_tick(&ist->pts_ticker, ist->sample_index);
+                ist->pts = ticker_abs(&ist->pts_ticker, ist->sample_index);
                 ist->sample_index += data_size / (2 * ist->st->codec.channels);
                 ist->pts_increment = (INT64) (data_size / (2 * ist->st->codec.channels)) * 1000000 / ist->st->codec.sample_rate;
                 break;
                 ist->sample_index += data_size / (2 * ist->st->codec.channels);
                 ist->pts_increment = (INT64) (data_size / (2 * ist->st->codec.channels)) * 1000000 / ist->st->codec.sample_rate;
                 break;
@@ -1063,7 +1063,7 @@ static int av_encode(AVFormatContext **output_files,
                 ist->frame_number++;
                 //ist->pts = ((INT64)ist->frame_number * 1000000 * FRAME_RATE_BASE) / 
                 //    ist->st->codec.frame_rate;
                 ist->frame_number++;
                 //ist->pts = ((INT64)ist->frame_number * 1000000 * FRAME_RATE_BASE) / 
                 //    ist->st->codec.frame_rate;
-                ist->pts = ticker_tick(&ist->pts_ticker, ist->frame_number);
+                ist->pts = ticker_abs(&ist->pts_ticker, ist->frame_number);
                 ist->pts_increment = ((INT64) 1000000 * FRAME_RATE_BASE) / 
                     ist->st->codec.frame_rate;
                 break;
                 ist->pts_increment = ((INT64) 1000000 * FRAME_RATE_BASE) / 
                     ist->st->codec.frame_rate;
                 break;
index a536549..8dac626 100644 (file)
@@ -578,11 +578,11 @@ static int asf_write_packet(AVFormatContext *s, int stream_index,
     stream = &asf->streams[stream_index];
     
     if (codec->codec_type == CODEC_TYPE_AUDIO) {
     stream = &asf->streams[stream_index];
     
     if (codec->codec_type == CODEC_TYPE_AUDIO) {
-        timestamp = (int)ticker_tick(&stream->pts_ticker, codec->frame_number);
+        timestamp = (int)ticker_abs(&stream->pts_ticker, codec->frame_number);
         duration = (codec->frame_number * codec->frame_size * INT64_C(10000000)) / 
             codec->sample_rate;
     } else {
         duration = (codec->frame_number * codec->frame_size * INT64_C(10000000)) / 
             codec->sample_rate;
     } else {
-        timestamp = (int)ticker_tick(&stream->pts_ticker, codec->frame_number);
+        timestamp = (int)ticker_abs(&stream->pts_ticker, codec->frame_number);
         duration = codec->frame_number * 
             ((INT64_C(10000000) * FRAME_RATE_BASE) / codec->frame_rate);
     }
         duration = codec->frame_number * 
             ((INT64_C(10000000) * FRAME_RATE_BASE) / codec->frame_rate);
     }