diff mbox series

[FFmpeg-devel] avformat/mpegts: fix stream index in verbose log message

Message ID 20211122000758.6128-1-cus@passwd.hu
State Accepted
Commit 0b9dbfab480004d7245013e1f9bf94c40a63f77f
Headers show
Series [FFmpeg-devel] avformat/mpegts: fix stream index in verbose log message | expand

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

Marton Balint Nov. 22, 2021, 12:07 a.m. UTC
Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavformat/mpegts.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Marton Balint Nov. 25, 2021, 6:11 p.m. UTC | #1
On Mon, 22 Nov 2021, Marton Balint wrote:

> Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
> libavformat/mpegts.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
> index 29a267436f..36ab7ab3af 100644
> --- a/libavformat/mpegts.c
> +++ b/libavformat/mpegts.c
> @@ -2238,11 +2238,10 @@ static AVStream *find_matching_stream(MpegTSContext *ts, int pid, unsigned int p
>                                       int stream_identifier, int pmt_stream_idx, struct Program *p)
> {
>     AVFormatContext *s = ts->stream;
> -    int i;
>     AVStream *found = NULL;
>
>     if (stream_identifier) { /* match based on "stream identifier descriptor" if present */
> -        for (i = 0; i < p->nb_streams; i++) {
> +        for (int i = 0; i < p->nb_streams; i++) {
>             if (p->streams[i].stream_identifier == stream_identifier)
>                 if (!found || pmt_stream_idx == i) /* fallback to idx based guess if multiple streams have the same identifier */
>                     found = s->streams[p->streams[i].idx];
> @@ -2255,7 +2254,7 @@ static AVStream *find_matching_stream(MpegTSContext *ts, int pid, unsigned int p
>         av_log(ts->stream, AV_LOG_VERBOSE,
>                "re-using existing %s stream %d (pid=0x%x) for new pid=0x%x\n",
>                av_get_media_type_string(found->codecpar->codec_type),
> -               i, found->id, pid);
> +               found->index, found->id, pid);
>     }
>
>     return found;
> -- 
> 2.31.1

Will apply.

Regards,
Marton
diff mbox series

Patch

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 29a267436f..36ab7ab3af 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -2238,11 +2238,10 @@  static AVStream *find_matching_stream(MpegTSContext *ts, int pid, unsigned int p
                                       int stream_identifier, int pmt_stream_idx, struct Program *p)
 {
     AVFormatContext *s = ts->stream;
-    int i;
     AVStream *found = NULL;
 
     if (stream_identifier) { /* match based on "stream identifier descriptor" if present */
-        for (i = 0; i < p->nb_streams; i++) {
+        for (int i = 0; i < p->nb_streams; i++) {
             if (p->streams[i].stream_identifier == stream_identifier)
                 if (!found || pmt_stream_idx == i) /* fallback to idx based guess if multiple streams have the same identifier */
                     found = s->streams[p->streams[i].idx];
@@ -2255,7 +2254,7 @@  static AVStream *find_matching_stream(MpegTSContext *ts, int pid, unsigned int p
         av_log(ts->stream, AV_LOG_VERBOSE,
                "re-using existing %s stream %d (pid=0x%x) for new pid=0x%x\n",
                av_get_media_type_string(found->codecpar->codec_type),
-               i, found->id, pid);
+               found->index, found->id, pid);
     }
 
     return found;