static void new_data_stream(AVFormatContext *oc, int file_idx)
{
    AVStream *st;
    AVCodec *codec=NULL;
    AVCodecContext *data_enc;
    st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
    if (!st) {
        fprintf(stderr, "Could not alloc stream\n");
        ffmpeg_exit(1);
    }
    new_output_stream(oc, file_idx);
    data_enc = st->codec;
    output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1);
    if (!data_stream_copy) {
        fprintf(stderr, "Data stream encoding not supported yet (only streamcopy)\n");
        ffmpeg_exit(1);
    }
    avcodec_get_context_defaults3(st->codec, codec);
    data_enc->codec_type = AVMEDIA_TYPE_DATA;
    if (data_codec_tag)
        data_enc->codec_tag= data_codec_tag;
    if (oc->oformat->flags & AVFMT_GLOBALHEADER) {
        data_enc->flags |= CODEC_FLAG_GLOBAL_HEADER;
        avcodec_opts[AVMEDIA_TYPE_DATA]->flags |= CODEC_FLAG_GLOBAL_HEADER;
    }
    if (data_stream_copy) {
        st->stream_copy = 1;
    }
    data_disable = 0;
    av_freep(&data_codec_name);
    data_stream_copy = 0;
}
['static void new_data_stream(AVFormatContext *oc, int file_idx)\n{\n    AVStream *st;\n    AVCodec *codec=NULL;\n    AVCodecContext *data_enc;\n    st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);\n    if (!st) {\n        fprintf(stderr, "Could not alloc stream\\n");\n        ffmpeg_exit(1);\n    }\n    new_output_stream(oc, file_idx);\n    data_enc = st->codec;\n    output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1);\n    if (!data_stream_copy) {\n        fprintf(stderr, "Data stream encoding not supported yet (only streamcopy)\\n");\n        ffmpeg_exit(1);\n    }\n    avcodec_get_context_defaults3(st->codec, codec);\n    data_enc->codec_type = AVMEDIA_TYPE_DATA;\n    if (data_codec_tag)\n        data_enc->codec_tag= data_codec_tag;\n    if (oc->oformat->flags & AVFMT_GLOBALHEADER) {\n        data_enc->flags |= CODEC_FLAG_GLOBAL_HEADER;\n        avcodec_opts[AVMEDIA_TYPE_DATA]->flags |= CODEC_FLAG_GLOBAL_HEADER;\n    }\n    if (data_stream_copy) {\n        st->stream_copy = 1;\n    }\n    data_disable = 0;\n    av_freep(&data_codec_name);\n    data_stream_copy = 0;\n}', 'AVStream *av_new_stream(AVFormatContext *s, int id)\n{\n    AVStream *st;\n    int i;\n    AVStream **streams;\n    if (s->nb_streams >= INT_MAX/sizeof(*streams))\n        return NULL;\n    streams = av_realloc(s->streams, (s->nb_streams + 1) * sizeof(*streams));\n    if (!streams)\n        return NULL;\n    s->streams = streams;\n    st = av_mallocz(sizeof(AVStream));\n    if (!st)\n        return NULL;\n    if (!(st->info = av_mallocz(sizeof(*st->info)))) {\n        av_free(st);\n        return NULL;\n    }\n    st->codec= avcodec_alloc_context();\n    if (s->iformat) {\n        st->codec->bit_rate = 0;\n    }\n    st->index = s->nb_streams;\n    st->id = id;\n    st->start_time = AV_NOPTS_VALUE;\n    st->duration = AV_NOPTS_VALUE;\n    st->cur_dts = 0;\n    st->first_dts = AV_NOPTS_VALUE;\n    st->probe_packets = MAX_PROBE_PACKETS;\n    av_set_pts_info(st, 33, 1, 90000);\n    st->last_IP_pts = AV_NOPTS_VALUE;\n    for(i=0; i<MAX_REORDER_DELAY+1; i++)\n        st->pts_buffer[i]= AV_NOPTS_VALUE;\n    st->reference_dts = AV_NOPTS_VALUE;\n    st->sample_aspect_ratio = (AVRational){0,1};\n    s->streams[s->nb_streams++] = st;\n    return st;\n}']