Browse code

Move new_output_stream() up for upcoming fix for issue 2317.

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

Carl Eugen Hoyos authored on 2010/10/29 23:48:38
Showing 1 changed files
... ...
@@ -633,6 +633,27 @@ static void choose_pixel_fmt(AVStream *st, AVCodec *codec)
633 633
     }
634 634
 }
635 635
 
636
+static AVOutputStream *new_output_stream(AVFormatContext *oc, int file_idx)
637
+{
638
+    int idx = oc->nb_streams - 1;
639
+    AVOutputStream *ost;
640
+
641
+    output_streams_for_file[file_idx] =
642
+        grow_array(output_streams_for_file[file_idx],
643
+                   sizeof(*output_streams_for_file[file_idx]),
644
+                   &nb_output_streams_for_file[file_idx],
645
+                   oc->nb_streams);
646
+    ost = output_streams_for_file[file_idx][idx] =
647
+        av_mallocz(sizeof(AVOutputStream));
648
+    if (!ost) {
649
+        fprintf(stderr, "Could not alloc output stream\n");
650
+        ffmpeg_exit(1);
651
+    }
652
+    ost->file_index = file_idx;
653
+    ost->index = idx;
654
+    return ost;
655
+}
656
+
636 657
 static int read_ffserver_streams(AVFormatContext *s, const char *filename)
637 658
 {
638 659
     int i, err;
... ...
@@ -3204,27 +3225,6 @@ static void check_audio_video_sub_inputs(int *has_video_ptr, int *has_audio_ptr,
3204 3204
     *has_subtitle_ptr = has_subtitle;
3205 3205
 }
3206 3206
 
3207
-static AVOutputStream *new_output_stream(AVFormatContext *oc, int file_idx)
3208
-{
3209
-    int idx = oc->nb_streams - 1;
3210
-    AVOutputStream *ost;
3211
-
3212
-    output_streams_for_file[file_idx] =
3213
-        grow_array(output_streams_for_file[file_idx],
3214
-                   sizeof(*output_streams_for_file[file_idx]),
3215
-                   &nb_output_streams_for_file[file_idx],
3216
-                   oc->nb_streams);
3217
-    ost = output_streams_for_file[file_idx][idx] =
3218
-        av_mallocz(sizeof(AVOutputStream));
3219
-    if (!ost) {
3220
-        fprintf(stderr, "Could not alloc output stream\n");
3221
-        ffmpeg_exit(1);
3222
-    }
3223
-    ost->file_index = file_idx;
3224
-    ost->index = idx;
3225
-    return ost;
3226
-}
3227
-
3228 3207
 static void new_video_stream(AVFormatContext *oc, int file_idx)
3229 3208
 {
3230 3209
     AVStream *st;