avformat: fix atomatic format selection for (s)segment
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 2 Apr 2013 19:48:25 +0000 (21:48 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 2 Apr 2013 19:52:40 +0000 (21:52 +0200)
Fixes Ticket2236

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/utils.c

index 0a12d8a..001b0e3 100644 (file)
@@ -222,6 +222,10 @@ AVOutputFormat *av_guess_format(const char *short_name, const char *filename,
 
 enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
                             const char *filename, const char *mime_type, enum AVMediaType type){
+    if (!strcmp(fmt->name, "segment") || !strcmp(fmt->name, "ssegment")) {
+        fmt = av_guess_format(NULL, filename, NULL);
+    }
+
     if(type == AVMEDIA_TYPE_VIDEO){
         enum AVCodecID codec_id= AV_CODEC_ID_NONE;