diff mbox series

[FFmpeg-devel,v2,2/2] avformat/mpegtsenc: reindent the code

Message ID 1598272899-24222-2-git-send-email-lance.lmwang@gmail.com
State Accepted
Commit 9bb4707b1faea6b6efe64b546c2be4a608ca64c1
Headers show
Series [FFmpeg-devel,v2,1/2] avformat/mpegtsenc: add registration descriptor for AC-3 and EAC3 | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Limin Wang Aug. 24, 2020, 12:41 p.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavformat/mpegtsenc.c | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

Comments

Marton Balint Aug. 24, 2020, 9:02 p.m. UTC | #1
On Mon, 24 Aug 2020, lance.lmwang@gmail.com wrote:

> From: Limin Wang <lance.lmwang@gmail.com>
>
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> ---
> libavformat/mpegtsenc.c | 36 ++++++++++++++++++------------------
> 1 file changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
> index 5a9e6fd..1559ce6 100644
> --- a/libavformat/mpegtsenc.c
> +++ b/libavformat/mpegtsenc.c
> @@ -1744,24 +1744,24 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
>                 av_log(s, AV_LOG_ERROR, "AAC bitstream not in ADTS format "
>                                         "and extradata missing\n");
>             } else {
> -            av_init_packet(&pkt2);
> -            pkt2.data = pkt->data;
> -            pkt2.size = pkt->size;
> -            av_assert0(pkt->dts != AV_NOPTS_VALUE);
> -            pkt2.dts = av_rescale_q(pkt->dts, st->time_base, ts_st->amux->streams[0]->time_base);
> -
> -            ret = avio_open_dyn_buf(&ts_st->amux->pb);
> -            if (ret < 0)
> -                return ret;
> -
> -            ret = av_write_frame(ts_st->amux, &pkt2);
> -            if (ret < 0) {
> -                ffio_free_dyn_buf(&ts_st->amux->pb);
> -                return ret;
> -            }
> -            size            = avio_close_dyn_buf(ts_st->amux->pb, &data);
> -            ts_st->amux->pb = NULL;
> -            buf             = data;
> +                av_init_packet(&pkt2);
> +                pkt2.data = pkt->data;
> +                pkt2.size = pkt->size;
> +                av_assert0(pkt->dts != AV_NOPTS_VALUE);
> +                pkt2.dts = av_rescale_q(pkt->dts, st->time_base, ts_st->amux->streams[0]->time_base);
> +
> +                ret = avio_open_dyn_buf(&ts_st->amux->pb);
> +                if (ret < 0)
> +                    return ret;
> +
> +                ret = av_write_frame(ts_st->amux, &pkt2);
> +                if (ret < 0) {
> +                    ffio_free_dyn_buf(&ts_st->amux->pb);
> +                    return ret;
> +                }
> +                size            = avio_close_dyn_buf(ts_st->amux->pb, &data);
> +                ts_st->amux->pb = NULL;
> +                buf             = data;
>             }
>         }
>     } else if (st->codecpar->codec_id == AV_CODEC_ID_HEVC) {

LGTM, thanks.

Regards,
Marton
diff mbox series

Patch

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 5a9e6fd..1559ce6 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -1744,24 +1744,24 @@  static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
                 av_log(s, AV_LOG_ERROR, "AAC bitstream not in ADTS format "
                                         "and extradata missing\n");
             } else {
-            av_init_packet(&pkt2);
-            pkt2.data = pkt->data;
-            pkt2.size = pkt->size;
-            av_assert0(pkt->dts != AV_NOPTS_VALUE);
-            pkt2.dts = av_rescale_q(pkt->dts, st->time_base, ts_st->amux->streams[0]->time_base);
-
-            ret = avio_open_dyn_buf(&ts_st->amux->pb);
-            if (ret < 0)
-                return ret;
-
-            ret = av_write_frame(ts_st->amux, &pkt2);
-            if (ret < 0) {
-                ffio_free_dyn_buf(&ts_st->amux->pb);
-                return ret;
-            }
-            size            = avio_close_dyn_buf(ts_st->amux->pb, &data);
-            ts_st->amux->pb = NULL;
-            buf             = data;
+                av_init_packet(&pkt2);
+                pkt2.data = pkt->data;
+                pkt2.size = pkt->size;
+                av_assert0(pkt->dts != AV_NOPTS_VALUE);
+                pkt2.dts = av_rescale_q(pkt->dts, st->time_base, ts_st->amux->streams[0]->time_base);
+
+                ret = avio_open_dyn_buf(&ts_st->amux->pb);
+                if (ret < 0)
+                    return ret;
+
+                ret = av_write_frame(ts_st->amux, &pkt2);
+                if (ret < 0) {
+                    ffio_free_dyn_buf(&ts_st->amux->pb);
+                    return ret;
+                }
+                size            = avio_close_dyn_buf(ts_st->amux->pb, &data);
+                ts_st->amux->pb = NULL;
+                buf             = data;
             }
         }
     } else if (st->codecpar->codec_id == AV_CODEC_ID_HEVC) {