From: Good Guy Date: Sat, 27 Jan 2018 23:24:05 +0000 (-0700) Subject: add ffmpeg raw pcm audio, pcm probe fixes X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=6fae7dd0f56872d524c1a6cf749a15574783f9e8;p=goodguy%2Fhistory.git add ffmpeg raw pcm audio, pcm probe fixes --- diff --git a/cinelerra-5.1/cinelerra/ffmpeg.C b/cinelerra-5.1/cinelerra/ffmpeg.C index b0ba1c90..2ed6c4a5 100644 --- a/cinelerra-5.1/cinelerra/ffmpeg.C +++ b/cinelerra-5.1/cinelerra/ffmpeg.C @@ -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 index 00000000..a97711db --- /dev/null +++ b/cinelerra-5.1/ffmpeg/audio/pcm.dfl @@ -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 index 00000000..a9c5b7e3 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/audio/s16.pcm @@ -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 index 00000000..a6830e22 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/audio/s24.pcm @@ -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 index 00000000..242fac5b --- /dev/null +++ b/cinelerra-5.1/ffmpeg/audio/s32.pcm @@ -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 index 00000000..346917b1 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/audio/s8.pcm @@ -0,0 +1 @@ +s8 pcm_s8