]> git.sesse.net Git - ffmpeg/blobdiff - ffmpeg.c
Revert r10892, it's wrong and no longer needed to prevent crashes
[ffmpeg] / ffmpeg.c
index 96a73fd0a18e9c6b5c99a4dc18e42872c9261087..a080dc99067909bae341711234073c7a4de86e14 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
 #include <signal.h>
 #include <limits.h>
 #include "avformat.h"
+#include "avdevice.h"
 #include "swscale.h"
 #include "framehook.h"
 #include "opt.h"
 #include "fifo.h"
 #include "avstring.h"
+#include "os_support.h"
 
 #if !defined(HAVE_GETRUSAGE) && defined(HAVE_GETPROCESSTIMES)
 #include <windows.h>
@@ -920,9 +922,9 @@ static void print_report(AVFormatContext **output_files,
 
     oc = output_files[0];
 
-    total_size = url_fsize(&oc->pb);
+    total_size = url_fsize(oc->pb);
     if(total_size<0) // FIXME improve url_fsize() so it works with non seekable output too
-        total_size= url_ftell(&oc->pb);
+        total_size= url_ftell(oc->pb);
 
     buf[0] = '\0';
     ti1 = 1e10;
@@ -1116,7 +1118,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
             switch(ist->st->codec->codec_type) {
             case CODEC_TYPE_AUDIO:
                 ist->next_pts += ((int64_t)AV_TIME_BASE * ist->st->codec->frame_size) /
-                    (ist->st->codec->sample_rate * ist->st->codec->channels);
+                    ist->st->codec->sample_rate;
                 break;
             case CODEC_TYPE_VIDEO:
                 if (ist->st->codec->time_base.num != 0) {
@@ -1397,7 +1399,7 @@ static int av_encode(AVFormatContext **output_files,
     int key;
     int want_sdp = 1;
 
-    file_table= (AVInputFile*) av_mallocz(nb_input_files * sizeof(AVInputFile));
+    file_table= av_mallocz(nb_input_files * sizeof(AVInputFile));
     if (!file_table)
         goto fail;
 
@@ -1948,7 +1950,7 @@ static int av_encode(AVFormatContext **output_files,
             break;
 
         /* finish if limit size exhausted */
-        if (limit_filesize != 0 && limit_filesize < url_ftell(&output_files[0]->pb))
+        if (limit_filesize != 0 && limit_filesize < url_ftell(output_files[0]->pb))
             break;
 
         /* read a frame from it and output it in the fifo */
@@ -3835,7 +3837,7 @@ static int av_exit()
         AVFormatContext *s = output_files[i];
         int j;
         if (!(s->oformat->flags & AVFMT_NOFILE))
-            url_fclose(&s->pb);
+            url_fclose(s->pb);
         for(j=0;j<s->nb_streams;j++) {
             av_free(s->streams[j]->codec);
             av_free(s->streams[j]);
@@ -3883,6 +3885,8 @@ int main(int argc, char **argv)
     int i;
     int64_t ti;
 
+    avcodec_register_all();
+    avdevice_register_all();
     av_register_all();
 
     for(i=0; i<CODEC_TYPE_NB; i++){