diff mbox series

[FFmpeg-devel,1/6] Fix dshow device name/description

Message ID 20220322133957.81743-2-toots@rastageeks.org
State Accepted
Commit 2a44db59cac9af255bfb4a1351b5113b713afcb5
Headers show
Series Various libavdevice cleanup & enhancements | expand

Checks

Context Check Description
yinshiyou/commit_msg_loongarch64 warning The first line of the commit message must start with a context terminated by a colon and a space, for example "lavu/opt: " or "doc: ".
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/commit_msg_x86 warning The first line of the commit message must start with a context terminated by a colon and a space, for example "lavu/opt: " or "doc: ".

Commit Message

Romain Beauxis March 22, 2022, 1:39 p.m. UTC
From: Romain Beauxis <romain.beauxis@nextstep.com>

Comments

Roger Pack March 22, 2022, 2:10 p.m. UTC | #1
On Tue, Mar 22, 2022 at 7:40 AM <toots@rastageeks.org> wrote:
>
> From: Romain Beauxis <romain.beauxis@nextstep.com>
>
> diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
> index 6039578ff9..4ee3f6e194 100644
> --- a/libavdevice/dshow.c
> +++ b/libavdevice/dshow.c
> @@ -552,8 +552,8 @@ dshow_cycle_devices(AVFormatContext *avctx, ICreateDevEnum *devenum,
>                  if (!device)
>                      goto fail;
>
> -                device->device_name = av_strdup(friendly_name);
> -                device->device_description = av_strdup(unique_name);
> +                device->device_name = av_strdup(unique_name);
> +                device->device_description = av_strdup(friendly_name);
>                  if (!device->device_name || !device->device_description)
>                      goto fail;
>

LGTM.
The device enumeration API was added only recently to dshow, guess a
bug crept in.
Thanks!
Diederick C. Niehorster March 22, 2022, 7:07 p.m. UTC | #2
On Tue, Mar 22, 2022 at 3:10 PM Roger Pack <rogerdpack2@gmail.com> wrote:
>
> On Tue, Mar 22, 2022 at 7:40 AM <toots@rastageeks.org> wrote:
> >
> > From: Romain Beauxis <romain.beauxis@nextstep.com>
> >
> > diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
> > index 6039578ff9..4ee3f6e194 100644
> > --- a/libavdevice/dshow.c
> > +++ b/libavdevice/dshow.c
> > @@ -552,8 +552,8 @@ dshow_cycle_devices(AVFormatContext *avctx, ICreateDevEnum *devenum,
> >                  if (!device)
> >                      goto fail;
> >
> > -                device->device_name = av_strdup(friendly_name);
> > -                device->device_description = av_strdup(unique_name);
> > +                device->device_name = av_strdup(unique_name);
> > +                device->device_description = av_strdup(friendly_name);
> >                  if (!device->device_name || !device->device_description)
> >                      goto fail;
> >
>
> LGTM.
> The device enumeration API was added only recently to dshow, guess a
> bug crept in.
> Thanks!

LGTM.

Indeed, this was code introduced by my patch, committed to the ffmpeg
repo only 91 days ago. Indeed, this should have been the other way
around given the documentation of struct AVDeviceInfo.

All the best,
Dee
Marton Balint April 9, 2022, 7:39 p.m. UTC | #3
On Tue, 22 Mar 2022, Diederick C. Niehorster wrote:

> On Tue, Mar 22, 2022 at 3:10 PM Roger Pack <rogerdpack2@gmail.com> wrote:
>>
>> On Tue, Mar 22, 2022 at 7:40 AM <toots@rastageeks.org> wrote:
>>>
>>> From: Romain Beauxis <romain.beauxis@nextstep.com>
>>>
>>> diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
>>> index 6039578ff9..4ee3f6e194 100644
>>> --- a/libavdevice/dshow.c
>>> +++ b/libavdevice/dshow.c
>>> @@ -552,8 +552,8 @@ dshow_cycle_devices(AVFormatContext *avctx, ICreateDevEnum *devenum,
>>>                  if (!device)
>>>                      goto fail;
>>>
>>> -                device->device_name = av_strdup(friendly_name);
>>> -                device->device_description = av_strdup(unique_name);
>>> +                device->device_name = av_strdup(unique_name);
>>> +                device->device_description = av_strdup(friendly_name);
>>>                  if (!device->device_name || !device->device_description)
>>>                      goto fail;
>>>
>>
>> LGTM.
>> The device enumeration API was added only recently to dshow, guess a
>> bug crept in.
>> Thanks!
>
> LGTM.
>
> Indeed, this was code introduced by my patch, committed to the ffmpeg
> repo only 91 days ago. Indeed, this should have been the other way
> around given the documentation of struct AVDeviceInfo.

Applied, thanks.

Marton

>
> All the best,
> Dee
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
diff mbox series

Patch

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 6039578ff9..4ee3f6e194 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -552,8 +552,8 @@  dshow_cycle_devices(AVFormatContext *avctx, ICreateDevEnum *devenum,
                 if (!device)
                     goto fail;
 
-                device->device_name = av_strdup(friendly_name);
-                device->device_description = av_strdup(unique_name);
+                device->device_name = av_strdup(unique_name);
+                device->device_description = av_strdup(friendly_name);
                 if (!device->device_name || !device->device_description)
                     goto fail;