add ffmpeg raw pcm audio, pcm probe fixes
authorGood Guy <good1.2guy@gmail.com>
Sat, 27 Jan 2018 23:24:05 +0000 (16:24 -0700)
committerGood Guy <good1.2guy@gmail.com>
Sat, 27 Jan 2018 23:24:05 +0000 (16:24 -0700)
cinelerra-5.1/cinelerra/ffmpeg.C
cinelerra-5.1/ffmpeg/audio/pcm.dfl [new file with mode: 0644]
cinelerra-5.1/ffmpeg/audio/s16.pcm [new file with mode: 0644]
cinelerra-5.1/ffmpeg/audio/s24.pcm [new file with mode: 0644]
cinelerra-5.1/ffmpeg/audio/s32.pcm [new file with mode: 0644]
cinelerra-5.1/ffmpeg/audio/s8.pcm [new file with mode: 0644]

index b0ba1c904be8f03b1543355c2d19305e0fa7fdd0..2ed6c4a5316878ef7091c22fc92fadcb530e0a24 100644 (file)
@@ -321,7 +321,8 @@ int FFStream::decode_activate()
                av_dict_copy(&copts, ffmpeg->opts, 0);
                int ret = 0;
                // this should be avformat_copy_context(), but no copy avail
-               ret = avformat_open_input(&fmt_ctx, ffmpeg->fmt_ctx->filename, NULL, &copts);
+               ret = avformat_open_input(&fmt_ctx,
+                       ffmpeg->fmt_ctx->filename, ffmpeg->fmt_ctx->iformat, &copts);
                if( ret >= 0 ) {
                        ret = avformat_find_stream_info(fmt_ctx, 0);
                        st = fmt_ctx->streams[fidx];
@@ -1931,7 +1932,9 @@ int FFMPEG::init_decoder(const char *filename)
        char file_opts[BCTEXTLEN];
        char *bp = strrchr(strcpy(file_opts, filename), '/');
        char *sp = strrchr(!bp ? file_opts : bp, '.');
+       if( !sp ) sp = bp + strlen(bp);
        FILE *fp = 0;
+       AVInputFormat *ifmt = 0;
        if( sp ) {
                strcpy(sp, ".opts");
                fp = fopen(file_opts, "r");
@@ -1939,12 +1942,16 @@ int FFMPEG::init_decoder(const char *filename)
        if( fp ) {
                read_options(fp, file_opts, opts);
                fclose(fp);
+               AVDictionaryEntry *tag;
+               if( (tag=av_dict_get(opts, "format", NULL, 0)) != 0 ) {
+                       ifmt = av_find_input_format(tag->value);
+               }
        }
        else
                load_options("decode.opts", opts);
        AVDictionary *fopts = 0;
        av_dict_copy(&fopts, opts, 0);
-       int ret = avformat_open_input(&fmt_ctx, filename, NULL, &fopts);
+       int ret = avformat_open_input(&fmt_ctx, filename, ifmt, &fopts);
        av_dict_free(&fopts);
        if( ret >= 0 )
                ret = avformat_find_stream_info(fmt_ctx, NULL);
diff --git a/cinelerra-5.1/ffmpeg/audio/pcm.dfl b/cinelerra-5.1/ffmpeg/audio/pcm.dfl
new file mode 100644 (file)
index 0000000..a97711d
--- /dev/null
@@ -0,0 +1 @@
+s16.s16
diff --git a/cinelerra-5.1/ffmpeg/audio/s16.pcm b/cinelerra-5.1/ffmpeg/audio/s16.pcm
new file mode 100644 (file)
index 0000000..a9c5b7e
--- /dev/null
@@ -0,0 +1 @@
+s16le pcm_s16le
diff --git a/cinelerra-5.1/ffmpeg/audio/s24.pcm b/cinelerra-5.1/ffmpeg/audio/s24.pcm
new file mode 100644 (file)
index 0000000..a6830e2
--- /dev/null
@@ -0,0 +1 @@
+s24le pcm_s24le
diff --git a/cinelerra-5.1/ffmpeg/audio/s32.pcm b/cinelerra-5.1/ffmpeg/audio/s32.pcm
new file mode 100644 (file)
index 0000000..242fac5
--- /dev/null
@@ -0,0 +1 @@
+s32le pcm_s32le
diff --git a/cinelerra-5.1/ffmpeg/audio/s8.pcm b/cinelerra-5.1/ffmpeg/audio/s8.pcm
new file mode 100644 (file)
index 0000000..346917b
--- /dev/null
@@ -0,0 +1 @@
+s8 pcm_s8