[FFmpeg-cvslog] avconv: drop code for special handling of avserver streams.

Anton Khirnov git at videolan.org
Sun Dec 11 01:12:51 CET 2011


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sat Dec 10 17:33:52 2011 +0100| [5bf663802233933aef81d220d7486b9c5be6ef3a] | committer: Anton Khirnov

avconv: drop code for special handling of avserver streams.

It's broken and doesn't work anyway.

This patch means that avconv will ignore encoding options from the ffm
file and will instead use whatever is provided on the commandline as for
normal output.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5bf663802233933aef81d220d7486b9c5be6ef3a
---

 avconv.c |   45 +--------------------------------------------
 1 files changed, 1 insertions(+), 44 deletions(-)

diff --git a/avconv.c b/avconv.c
index 3b1500b..0bc5aa0 100644
--- a/avconv.c
+++ b/avconv.c
@@ -3518,40 +3518,6 @@ static int copy_chapters(InputFile *ifile, OutputFile *ofile, int copy_metadata)
     return 0;
 }
 
-static int read_avserver_streams(OptionsContext *o, AVFormatContext *s, const char *filename)
-{
-    int i, err;
-    AVFormatContext *ic = avformat_alloc_context();
-
-    ic->interrupt_callback = int_cb;
-    err = avformat_open_input(&ic, filename, NULL, NULL);
-    if (err < 0)
-        return err;
-    /* copy stream format */
-    for(i=0;i<ic->nb_streams;i++) {
-        AVStream *st;
-        OutputStream *ost;
-        AVCodec *codec;
-
-        codec = avcodec_find_encoder(ic->streams[i]->codec->codec_id);
-        ost   = new_output_stream(o, s, codec->type);
-        st    = ost->st;
-
-        // FIXME: a more elegant solution is needed
-        memcpy(st, ic->streams[i], sizeof(AVStream));
-        st->info = NULL;
-        avcodec_copy_context(st->codec, ic->streams[i]->codec);
-
-        if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && !ost->stream_copy)
-            choose_sample_fmt(st, codec);
-        else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && !ost->stream_copy)
-            choose_pixel_fmt(st, codec);
-    }
-
-    av_close_input_file(ic);
-    return 0;
-}
-
 static void opt_output_file(void *optctx, const char *filename)
 {
     OptionsContext *o = optctx;
@@ -3589,16 +3555,7 @@ static void opt_output_file(void *optctx, const char *filename)
     oc->interrupt_callback = int_cb;
     av_strlcpy(oc->filename, filename, sizeof(oc->filename));
 
-    if (!strcmp(file_oformat->name, "ffm") &&
-        av_strstart(filename, "http:", NULL)) {
-        /* special case for files sent to avserver: we get the stream
-           parameters from avserver */
-        int err = read_avserver_streams(o, oc, filename);
-        if (err < 0) {
-            print_error(filename, err);
-            exit_program(1);
-        }
-    } else if (!o->nb_stream_maps) {
+    if (!o->nb_stream_maps) {
         /* pick the "best" stream of each type */
 #define NEW_STREAM(type, index)\
         if (index >= 0) {\



More information about the ffmpeg-cvslog mailing list