diff mbox series

[FFmpeg-devel,05/17] avformat/mxfenc: Remove redundant check

Message ID AM7PR03MB6660C7EFA80E1E68722F22DD8F929@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit ea81c23c942088bf7099f176ac3cd0b993b64779
Headers show
Series [FFmpeg-devel,01/17] avformat/mxfenc: Auto-insert h264_mp4toannexb BSF if needed
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Nov. 9, 2021, 6:01 p.m. UTC
None of the muxers here has the AVFMT_NOSTREAMS flag set,
so it is checked generically that there are streams.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/mxfenc.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Tomas Härdin Nov. 9, 2021, 9:11 p.m. UTC | #1
tis 2021-11-09 klockan 19:01 +0100 skrev Andreas Rheinhardt:
> None of the muxers here has the AVFMT_NOSTREAMS flag set,
> so it is checked generically that there are streams.

Didn't know about AVFMT_NOSTREAMS

> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavformat/mxfenc.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
> index 3b6604d0d6..fd9e2c4c48 100644
> --- a/libavformat/mxfenc.c
> +++ b/libavformat/mxfenc.c
> @@ -2507,9 +2507,6 @@ static int mxf_write_header(AVFormatContext *s)
>      uint8_t present[FF_ARRAY_ELEMS(mxf_essence_container_uls)] =
> {0};
>      int64_t timestamp = 0;
>  
> -    if (!s->nb_streams)
> -        return -1;

Looks OK

/Tomas
diff mbox series

Patch

diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 3b6604d0d6..fd9e2c4c48 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -2507,9 +2507,6 @@  static int mxf_write_header(AVFormatContext *s)
     uint8_t present[FF_ARRAY_ELEMS(mxf_essence_container_uls)] = {0};
     int64_t timestamp = 0;
 
-    if (!s->nb_streams)
-        return -1;
-
     if (s->oformat == &ff_mxf_opatom_muxer && s->nb_streams !=1) {
         av_log(s, AV_LOG_ERROR, "there must be exactly one stream for mxf opatom\n");
         return -1;