[vlc-commits] mtp: set input item duration directly

Rémi Denis-Courmont git at videolan.org
Sun May 14 21:29:22 CEST 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun May 14 21:43:22 2017 +0300| [f3a31e6893555b39b6deb04dedaa39d4a9f5e1fc] | committer: Rémi Denis-Courmont

mtp: set input item duration directly

No need to lock here. The item is not visible to any other threads
until services_discovery_Add(Sub)Item().

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f3a31e6893555b39b6deb04dedaa39d4a9f5e1fc
---

 modules/services_discovery/mtp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/services_discovery/mtp.c b/modules/services_discovery/mtp.c
index e79d04a1f1..56be3e3f6d 100644
--- a/modules/services_discovery/mtp.c
+++ b/modules/services_discovery/mtp.c
@@ -266,7 +266,7 @@ static void AddTrack( services_discovery_t *p_sd, LIBMTP_track_t *p_track )
         free( psz_string );
     }
     input_item_SetDate( p_input, p_track->date );
-    input_item_SetDuration( p_input, p_track->duration * 1000 );
+    p_input->i_duration = p_track->duration * INT64_C(1000);
     services_discovery_AddItem( p_sd, p_input );
     p_sd->p_sys->pp_items[p_sd->p_sys->i_count++] = p_input;
 }



More information about the vlc-commits mailing list