[FFmpeg-devel,1/2] ffmpeg: treat audio streams with no parsed packets like unknown streams

Submitted by Rodger Combs on May 2, 2017, 1:42 a.m.

Details

Message ID 20170502014218.83855-1-rodger.combs@gmail.com
State New
Headers show

Commit Message

Rodger Combs May 2, 2017, 1:42 a.m.
---
 ffmpeg_opt.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Michael Niedermayer May 2, 2017, 6:02 p.m.
On Mon, May 01, 2017 at 08:42:17PM -0500, Rodger Combs wrote:
> ---
>  ffmpeg_opt.c | 8 ++++++++
>  1 file changed, 8 insertions(+)

probably ok

please also add a testcase to fate for this

[...]

Patch hide | download patch | download mbox

diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index d1fe8742ff..5ed29d717e 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -2255,6 +2255,14 @@  loop_end:
                 if(o->    data_disable && ist->st->codecpar->codec_type == AVMEDIA_TYPE_DATA)
                     continue;
 
+                if (ignore_unknown_streams &&
+                    ist->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO &&
+                    ist->st->codecpar->sample_rate <= 0) {
+                    av_log(NULL, AV_LOG_WARNING, "Skipping stream #%d:%d - not parsed.\n",
+                           map->file_index, map->stream_index);
+                    continue;
+                }
+
                 ost = NULL;
                 switch (ist->st->codecpar->codec_type) {
                 case AVMEDIA_TYPE_VIDEO:      ost = new_video_stream     (o, oc, src_idx); break;