History

lavf/rawenc: Only accept the appropriate stream type for raw muxers.

This does not affect the rawvideo muxer. Fixes ticket #7979.

Carl Eugen Hoyos committed 7 years ago

Commit aef24ef1 parent 48576881 file · +12 −0Browse files

Unified · Split

libavformat/rawenc.c+12−0
@@ -39,6 +39,18 @@ static int force_one_stream(AVFormatContext *s) · 38 unmodified lines
3939 s->oformat->name);
4040 return AVERROR(EINVAL);
4141 }
42+ if ( s->oformat->audio_codec != AV_CODEC_ID_NONE
43+ && s->streams[0]->codecpar->codec_type != AVMEDIA_TYPE_AUDIO) {
44+ av_log(s, AV_LOG_ERROR, "%s files have exactly one audio stream\n",
45+ s->oformat->name);
46+ return AVERROR(EINVAL);
47+ }
48+ if ( s->oformat->video_codec != AV_CODEC_ID_NONE
49+ && s->streams[0]->codecpar->codec_type != AVMEDIA_TYPE_VIDEO) {
50+ av_log(s, AV_LOG_ERROR, "%s files have exactly one video stream\n",
51+ s->oformat->name);
52+ return AVERROR(EINVAL);
53+ }
4254 return 0;
4355 }
4456

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t